From 35e157d84dd374d64783f1d8dd436666ae80edf9 Mon Sep 17 00:00:00 2001 From: Viktor Liu Date: Wed, 8 Jul 2026 09:40:49 +0200 Subject: [PATCH] Fix TestResetAggregationWindow flake on coarse OS clocks --- client/internal/netflow/store/event_aggregation_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/internal/netflow/store/event_aggregation_test.go b/client/internal/netflow/store/event_aggregation_test.go index c0422e8b7..2406290ef 100644 --- a/client/internal/netflow/store/event_aggregation_test.go +++ b/client/internal/netflow/store/event_aggregation_test.go @@ -176,6 +176,10 @@ func TestFlowAggregationOfUnknownProtocols(t *testing.T) { func TestResetAggregationWindow(t *testing.T) { store := NewAggregatingMemoryStore() + // Backdate the window start: the reset below happens within the OS + // clock granularity (~15ms on Windows), which would otherwise make + // the old and new window start timestamps identical. + store.WindowStart = store.WindowStart.Add(-time.Second) store.StoreEvent(&types.Event{ ID: uuid.New(), Timestamp: time.Now(),