Skip to content

test(precompute): add a wall-clock override hook to PrecomputeEngine - #537

Open
milindsrivastava1997 wants to merge 2 commits into
474-fixprecompute-bulk-single-timestamp-ingest-silently-drops-rows-when-wall-clock-fallback-closes-the-window-mid-ingest-1from
474-precompute-wall-clock-e2e-test-hook
Open

test(precompute): add a wall-clock override hook to PrecomputeEngine#537
milindsrivastava1997 wants to merge 2 commits into
474-fixprecompute-bulk-single-timestamp-ingest-silently-drops-rows-when-wall-clock-fallback-closes-the-window-mid-ingest-1from
474-precompute-wall-clock-e2e-test-hook

Conversation

@milindsrivastava1997

Copy link
Copy Markdown
Contributor

Summary

  • Stacked on fix(precompute): keep wall-clock fallback from force-closing panes still under active ingest #536. Test-support infrastructure only, no behavior change.
  • Worker already has a fake-clock override (set_now_ms_fn) for its own unit tests, but it's #[cfg(test)]-gated and invisible to integration tests under tests/, which link the library normally. Widened it to pub(crate) (no longer test-cfg-gated) and added PrecomputeEngine::with_now_ms_fn, a builder that threads a shared clock override down to every spawned worker.
  • Lets an integration test drive the wall-clock fallback deterministically through the real ingest pipeline instead of racing a real clock with sleeps. Not consumed by anything yet — used in Remove old repo name from codebase #3.
  • The override defaults to None; every worker keeps its default SystemTime::now-backed clock unless a caller opts in. Production code never calls with_now_ms_fn.

Test plan

  • Full precompute_engine:: unit suite (81 tests) passes.
  • cargo clippy -p query_engine_rust --lib --tests clean.

🤖 Generated with Claude Code

Stacked on the #474 fix. Worker already has a fake-clock override
(set_now_ms_fn) for its own unit tests, but it's #[cfg(test)]-gated and
invisible to integration tests under tests/, which link the library
normally. Widen it to pub(crate) and add PrecomputeEngine::with_now_ms_fn,
a builder that threads a shared clock override down to every spawned
worker, so an integration test can drive the wall-clock fallback
deterministically through the real ingest pipeline instead of racing a
real clock with sleeps.

No behavioral change: the override defaults to None and every worker keeps
its default SystemTime::now-backed clock unless a caller opts in.
Production code never calls with_now_ms_fn.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…-drops-rows-when-wall-clock-fallback-closes-the-window-mid-ingest-1' into 474-precompute-wall-clock-e2e-test-hook
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