Skip to content

test(query): seed both edge-yield fixtures from one timestamp - #323

Merged
vishr merged 1 commit into
mainfrom
fix/edge-yield-flake
Oct 16, 2026
Merged

vishr merged 1 commit into
mainfrom
fix/edge-yield-flake

Conversation

@vishr

@vishr vishr commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Summary

TestEdgeRollupYieldsToAQueuedPublisher failed once in CI under just test-race:

queued and undisturbed passes must each commit one sub-window: queued=1792158600000000000 undisturbed=1792158540000000000

Each fixture database took its own time.Now().Truncate(time.Minute). If setup crossed a minute boundary, their earliest buckets differed by one minute. Each pass still committed one sub-window, but the cursors then differed by exactly 60 seconds.

The fix takes the base time once per test, passes it to both fixtures, and asserts the expected cursor exactly. No product code changes.

Verification

  • A temporary overlay that forced the minute rollover reproduced the exact 60-second mismatch.
  • -race -count=200 on the test, with the default GOMAXPROCS and with GOMAXPROCS=2: 0 failures in both.
  • go test -race ./internal/query/...: passed.
  • just check (pre-push): passed.

TestEdgeRollupYieldsToAQueuedPublisher seeded two databases, each taking its
own time.Now().Truncate(time.Minute). When setup crossed a minute boundary
the fixtures' earliest buckets differed by a minute, so the two passes'
cursors differed by exactly 60 seconds and the comparison failed under the
race detector on a loaded runner. Take the base time once per test, pass it
to both fixtures, and assert the expected cursor exactly.

Claude-Session: https://claude.ai/code/session_01XA52nWyQ3R5f5kK8kjpAQW
@vishr
vishr force-pushed the fix/edge-yield-flake branch from 5643656 to f41baa9 Compare October 16, 2026 19:52
@vishr
vishr merged commit da961b6 into main Oct 16, 2026
14 checks passed
@vishr
vishr deleted the fix/edge-yield-flake branch October 16, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant