summaryrefslogtreecommitdiff
path: root/integrationtests/expectations.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-21 19:59:28 +0200
committerPaul Buetow <paul@buetow.org>2026-02-21 19:59:28 +0200
commit5824a1959b27643575c5b1335f211687566b8449 (patch)
tree480ae8244efc014aa51e151a9dfb1ee59b0ee8db /integrationtests/expectations.go
parent5234ae813b60b823bc984ca8862f078ed4fe71a6 (diff)
Fix integration test harness: symlink BPF object, increase grace period, improve assertions
- Symlink ior.bpf.o into output dir so ior finds it when run from temp dir - Increase iorShutdownGrace from 3s to 30s for BPF tracepoint unloading - Skip records with empty comm in AssertNoUnexpectedComm (BPF race condition) - Add diagnostic logging (up to 5 samples) in both AssertNoUnexpectedComm and AssertNoUnexpectedPID for easier debugging of test failures Amp-Thread-ID: https://ampcode.com/threads/T-019c814e-d6b6-72fb-aaf0-c49f5b3fd04e Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'integrationtests/expectations.go')
-rw-r--r--integrationtests/expectations.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/integrationtests/expectations.go b/integrationtests/expectations.go
index ed155bc..6a816e6 100644
--- a/integrationtests/expectations.go
+++ b/integrationtests/expectations.go
@@ -39,13 +39,21 @@ func AssertEventsPresent(t *testing.T, result TestResult, expected []ExpectedEve
}
// AssertNoUnexpectedComm verifies all records have the expected comm name.
-// Fails fast on the first mismatch and reports the total count of unexpected records.
+// Records with empty comm are skipped because BPF may capture events before
+// the process name is set in the task struct.
func AssertNoUnexpectedComm(t *testing.T, result TestResult, expectedComm string) {
t.Helper()
var count int
for _, rec := range result.Records {
+ if rec.Comm == "" {
+ continue
+ }
if rec.Comm != expectedComm {
count++
+ if count <= 5 {
+ t.Logf("unexpected comm %q (pid=%d tracepoint=%s path=%q)",
+ rec.Comm, rec.Pid, rec.TraceID.String(), rec.Path)
+ }
}
}
if count > 0 {
@@ -62,6 +70,10 @@ func AssertNoUnexpectedPID(t *testing.T, result TestResult, expectedPID int) {
for _, rec := range result.Records {
if rec.Pid != pid {
count++
+ if count <= 5 {
+ t.Logf("unexpected PID %d (tracepoint=%s path=%q comm=%q)",
+ rec.Pid, rec.TraceID.String(), rec.Path, rec.Comm)
+ }
}
}
if count > 0 {