diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-23 21:57:35 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-23 21:57:35 +0200 |
| commit | c58ef78b4a79a5cbc9531a74c6e3965ea4c00bc2 (patch) | |
| tree | 29944a45cf7d00d781a232020b327203b1a72b75 /integrationtests/open_test.go | |
| parent | aa19be8c624a6adc3ecbf11a6ee0506a5c7d34fe (diff) | |
Harden integration workloads against dropped event flakes
Diffstat (limited to 'integrationtests/open_test.go')
| -rw-r--r-- | integrationtests/open_test.go | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/integrationtests/open_test.go b/integrationtests/open_test.go index 2a3b77a..98419ad 100644 --- a/integrationtests/open_test.go +++ b/integrationtests/open_test.go @@ -112,6 +112,10 @@ func TestOpenDurationGap(t *testing.T) { // We intentionally sleep 800ms between first and second openat. const minGapNs = uint64(500 * 1_000_000) + var ( + found bool + maxGap uint64 + ) for _, rec := range result.Records { if !strings.Contains(rec.TraceID.String(), "enter_openat") { continue @@ -119,11 +123,16 @@ func TestOpenDurationGap(t *testing.T) { if !strings.Contains(rec.Path, "gap-shared.txt") { continue } - if rec.Cnt.DurationToPrev < minGapNs { - t.Fatalf("durationToPrev for second openat = %d ns, want >= %d ns", rec.Cnt.DurationToPrev, minGapNs) + found = true + if rec.Cnt.DurationToPrev > maxGap { + maxGap = rec.Cnt.DurationToPrev } - return } - t.Fatalf("did not find openat record for gap-shared.txt") + if !found { + t.Fatalf("did not find openat record for gap-shared.txt") + } + if maxGap < minGapNs { + t.Fatalf("max durationToPrev for openat gap-shared.txt = %d ns, want >= %d ns", maxGap, minGapNs) + } } |
