Repository navigation
test: step the scheduler's database clock instead of waiting on wall time - #1534
Merged
Merged
Conversation
…time Due-time selection, lease takeover and the next-wake read now run against a task-local database clock set by the test, and assert tick counts and exact waits per cycle. One real-clock run remains, with a single due time and a generous bound, to catch a scheduler that hangs; it fails clearly when setup runs past the due time.
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.
Why
The scheduler latency test checked an exact tick count inside a real-time window, with due times set before migration, location setup and publication. On a slow Windows runner it decided 2 of 3 ticks: either setup ran past a due time, or one cycle stalled long enough for two times to be overdue together. The test could not say which, because it printed its timings only after the count assertion.
Changes
refresh_clockreads. In test builds only, a task-local clock can override it, so a test sets the database time instead of waiting for it. Production code paths and signatures are unchanged.DuckShop: no case added. This is a scheduler test change with no project shape, data value or build lifecycle sequence.
Verification
cargo test -p sqlbuild-orchestration --lib -- scheduler::on SQLite and PostgreSQL: 19 passed.make check-cipassed on the head.