mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-05-17 08:36:55 +03:00
synctest runs inner closure in a new goroutine, which makes `t.Helper` instruction useless on `t.Fatalf` checks. So when test fails we observe the log line where `t.Fatalf` was called, instead of where `f()` was called. Moving checks out of synctest closure makes `t.Helper` useful again. -- In the synctest we were waiting for ingest a new batch of samples for aggregation interval. Because of this, the new batch had 50% chance to be ingested in the previous or current aggregation interval, depending on whether go run time initiated flush() call or no. This change waits for additional 1ms for flush to happen. Locally, it stopped producing flaky tests. --------- Signed-off-by: hagen1778 <roman@victoriametrics.com>