mirror of
https://github.com/hyperdxio/hyperdx
synced 2026-04-21 13:37:15 +00:00
Fix flaky charts integration test due to minute-boundary timing (#1923)
## Summary - Fixes flaky integration test in `charts.test.ts` where 12 of 27 tests intermittently fail - Root cause: test data timestamps (`now` and `now + 1000`) sometimes straddle a ClickHouse 1-minute time bucket boundary, producing 2 rows instead of the expected 1 - Fix: floor the base timestamp to the start of the minute so both data points always land in the same bucket ## Failing CI run https://github.com/hyperdxio/hyperdx/actions/runs/23056501733/job/66971286014
This commit is contained in:
parent
e09c8c0e5d
commit
81fe186e8a
1 changed files with 4 additions and 1 deletions
|
|
@ -18,7 +18,10 @@ import Connection from '../../../models/connection';
|
|||
import { ISource, Source } from '../../../models/source';
|
||||
|
||||
// Default time range for tests (1 hour)
|
||||
const DEFAULT_END_TIME = Date.now();
|
||||
// Floor to minute so all derived timestamps (including test data inserted at
|
||||
// `now` and `now + 1000`) always fall within the same 1-minute ClickHouse time
|
||||
// bucket, preventing flaky results when timestamps straddle a minute boundary.
|
||||
const DEFAULT_END_TIME = Math.floor(Date.now() / 60000) * 60000;
|
||||
const DEFAULT_START_TIME = DEFAULT_END_TIME - 3600 * 1000;
|
||||
|
||||
// Helper to create standard series request payload
|
||||
|
|
|
|||
Loading…
Reference in a new issue