Skip to content

Commit 71f319e

Browse files
committed
fix: redis flake
1 parent 8b6fb36 commit 71f319e

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

integration/root/observability_integration_test.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,24 @@ func TestObservabilityIntegration_AllBackends(t *testing.T) {
217217
}
218218
waitForObservabilityScenario(t, "collector_drained", drainWait, func() bool {
219219
snapshot := collector.Snapshot()
220-
return snapshot.Pending(fx.queue) == 0 && snapshot.Active(fx.queue) == 0
220+
if snapshot.Pending(fx.queue) == 0 && snapshot.Active(fx.queue) == 0 {
221+
return true
222+
}
223+
if fx.name != testenv.BackendRedis || snapshot.Active(fx.queue) != 0 {
224+
return false
225+
}
226+
227+
// Redis native stats are authoritative for queue depth; allow this
228+
// fallback when observer-driven pending lags under CI load.
229+
nativeSnapshot, err := queue.Snapshot(context.Background(), q, collector)
230+
if err != nil {
231+
return false
232+
}
233+
nativeCounters, ok := nativeSnapshot.Queue(fx.queue)
234+
if !ok {
235+
return false
236+
}
237+
return nativeCounters.Pending == 0 && nativeCounters.Active == 0
221238
})
222239
snapshot := collector.Snapshot()
223240
throughput, ok := snapshot.Throughput(fx.queue)

0 commit comments

Comments
 (0)