Skip to content

Commit 7a56dbf

Browse files
committed
Fix rtld tests
1 parent ae5e0cf commit 7a56dbf

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

interpreter/rtld/rtld_test.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)