test(precompute): add a wall-clock override hook to PrecomputeEngine - #537
Conversation
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>
4 tasks
…-drops-rows-when-wall-clock-fallback-closes-the-window-mid-ingest-1' into 474-precompute-wall-clock-e2e-test-hook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Workeralready 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 undertests/, which link the library normally. Widened it topub(crate)(no longer test-cfg-gated) and addedPrecomputeEngine::with_now_ms_fn, a builder that threads a shared clock override down to every spawned worker.None; every worker keeps its defaultSystemTime::now-backed clock unless a caller opts in. Production code never callswith_now_ms_fn.Test plan
precompute_engine::unit suite (81 tests) passes.cargo clippy -p query_engine_rust --lib --testsclean.🤖 Generated with Claude Code