File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,8 +32,13 @@ func test(t *testing.T) {
3232 log .SetLevel (log .DebugLevel )
3333 }
3434
35- // Create a context for the tracer
36- ctx , cancel := context .WithTimeout (context .Background (), 30 * time .Second )
35+ // Create a context for the tracer. We use WithCancel (not WithTimeout)
36+ // because under QEMU emulation the tracer startup (eBPF program loading
37+ // and verification) can take 30+ seconds, which would cause a timeout
38+ // context to expire before ForceProcessPID is called, killing the PID
39+ // event processing goroutines. The require.Eventually below handles the
40+ // test-level timeout instead.
41+ ctx , cancel := context .WithCancel (context .Background ())
3742 defer cancel ()
3843
3944 // Start the tracer with all tracers enabled
@@ -43,9 +48,7 @@ func test(t *testing.T) {
4348 false )
4449 defer trc .Close ()
4550
46- trc .StartPIDEventProcessor (ctx )
47-
48- // tickle tihs process to speed things up
51+ // tickle this process to speed things up
4952 trc .ForceProcessPID (libpf .PID (uint32 (os .Getpid ())))
5053
5154 // Consume traces to prevent blocking
You can’t perform that action at this time.
0 commit comments