MCPcopy Create free account
hub / github.com/prometheus/procfs / TestAllThreads

Function TestAllThreads

thread_test.go:30–47  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

28)
29
30func TestAllThreads(t *testing.T) {
31 fixFS := getProcFixtures(t)
32 threads, err := fixFS.AllThreads(testPID)
33 if err != nil {
34 t.Fatal(err)
35 }
36 sort.Sort(threads)
37 for i, tid := range testTIDS {
38 if diff := cmp.Diff(tid, threads[i].PID); diff != "" {
39 t.Fatalf("unexpected diff (-want +got):\n%s", diff)
40 }
41 wantFS := fixFS.proc.Path(strconv.Itoa(testPID), "task")
42 haveFS := string(threads[i].fs.proc)
43 if diff := cmp.Diff(wantFS, haveFS); diff != "" {
44 t.Fatalf("unexpected diff (-want +got):\n%s", diff)
45 }
46 }
47}
48
49func TestThreadStat(t *testing.T) {
50 // Pull process and thread stats.

Callers

nothing calls this directly

Calls 3

getProcFixturesFunction · 0.85
AllThreadsMethod · 0.80
PathMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…