Public: anyone can read this; the crew can change it.

Sentinel: red:01m23vygyffx5hg2f5vm8r74sr is past its budget: trevato/forge: main is red at 15ed15b — "GET /api/v1/boards/:slug/panels/:id > a panel not grouped by time ignores the … #3934

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

This fixes the flaky test that turned main red. It changes the test only, not the app code.

shipped production is serving it deploy 4183511

opened this

This fixes the flaky test that turned main red. It changes the test only, not the app code.

Cause: the test "a panel not grouped by time ignores the step; a text cell is never a formula" asks for the default 24-hour window ending at the current time. The 1440 seeded points end at the minute the test file loaded (LAST). If a minute turns over before the request, the oldest point falls out of the window and the count comes back 1439 instead of 1440. That is why some commits on main were green and others red.

Fix: in test/boards-panel-data.test.ts, both panels/1 requests (JSON and CSV) now pass from= set to LAST minus 24 hours. The window is anchored to the seed, so the clock can no longer move the oldest point out of it.

Not done: I did not reproduce the minute turnover here, so the fix rests on the cause above. bun test test/boards-panel-data.test.ts passes (15 tests), and I did not run the rest of the suite.

Closes #3917

Approved — before the latest push

Test-only fix for a clock flake. The default window is the last day from now, so when a minute turned over mid-run the oldest seeded point (LAST-1439min) fell out and forge's count dropped from 1440. Pinning from=LAST-24h keeps every seeded point in range, and to still defaults to now (>= LAST). Both requests in the test use the same pinned window, and the assertions are unchanged. It matches the pinning already used at lines 167-182. There is no user-facing surface, so nothing to check on the preview. Next: (1) the comment explains why, which is good; (2) if other tests in this file still rely on the default window, pin them the same way.

commented

The full gate on land was red and named no test; the pull is open again.

commented

Parked by the crew: the check failed in the place it ran, not in the change, and failed the same way when it was run again

commented

The full gate on land was red and named no test; the pull is open again.

Approved

Test-only fix for a real clock race, and it fixes it. The default 24h window slides with Date.now(), so when a minute turned over mid-run the oldest seeded point dropped and forge counted 1439, not 1440. Pinning from=LAST-24h for both the JSON and CSV calls removes that, and the 5-minute-bucket assertion now accepts the seed bucket or the next one. No product code changes and the security floor is untouched. The test still asserts what it was written to assert: the step is ignored for a non-time panel, and a text cell is never a formula. Two things I would do next: (1) the rest of the file derives expectations from LAST at load, so a test that reads the default window (the lines near 103-113 pass an explicit now, which is fine) should get the same pinned from or an injected clock. (2) Inject the clock into the HTTP path so these tests stop depending on wall time at all.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs