Repository navigation
Conversation
Alenar
requested review from
damrobi,
jpraynaud and
turmelclem
as code owners
October 15, 2026 11:08
Test Results 5 files ±0 226 suites ±0 1h 0m 41s ⏱️ - 4m 4s Results for commit 663b6a9. ± Comparison against base commit 4eb474c. This pull request removes 3 and adds 3 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A repeater test can pass its pre-delay assertion before the spawned task has run.
1 open finding
What changed in this PR
This PR makes async tests less dependent on real-clock sleeps, reducing timing-related failures on loaded CI machines.
Changes:
- Replaces client feedback sleeps with task handshakes.
- Uses paused clocks to test relay and aggregator delays, and shortens other relay test delays.
- Renames an aggregator
Durationparameter for clarity.
| File | Description |
|---|---|
mithril-relay/src/repeater.rs |
Updates repeater timing tests. |
mithril-relay/Cargo.toml |
Enables Tokio test utilities. |
mithril-client/src/feedback.rs |
Coordinates feedback tests with notifications. |
mithril-aggregator/src/services/signature_processor.rs |
Updates processor timing tests and parameter naming. |
🧠 Review effort: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Several tests used real-clock sleeps to order tasks or check delays, which made them flaky on loaded CI machines. - client: the feedback tests now take turns through `Notify` handshakes instead of sleeps. They are renamed to `*_task(s)` since they use tasks, not threads. - relay: the repeater delay tests use a paused clock and explicit `time::advance` calls to check the message is not repeated before the delay ends and is repeated once it does. The other repeater tests use a shorter delay so they run faster. - aggregator: the signature processor stops once a registration is notified, with a timeout so the test can't hang, and the retry-delay test advances a paused clock to just before the delay ends. Both tests now fail if the processor stops on its own instead of passing silently. - aggregator: rename the `wait_delay_on_error_in_seconds` parameter to `wait_delay_on_error` since it is a `Duration`.
Alenar
force-pushed
the
djo/test/fix-flaky-sleep-based-tests
branch
from
October 15, 2026 13:02
88e8982 to
663b6a9
Compare
This branch was successfully deployed
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.

Content
This PR includes fixes to tests that used real-clock sleeps to order tasks or check delays, which made them flaky on loaded CI machines.
This problem was identified for one the
mithril-clientfeedbacktest by the following failing hydra run: https://ci.iog.io/build/15142234/nixlog/1. I then searched other potential offender in the code base.Details:
Notifyhandshakes instead of sleeps. They are renamed to*_task(s)since they use tasks, not threads.time::advancecalls to check the message is not repeated before the delay ends and is repeated once it does.The other repeater tests use a shorter delay so they run faster.
Both tests now fail if the processor stops on its own instead of passing silently.
wait_delay_on_error_in_secondsparameter towait_delay_on_errorsince it is aDuration.Pre-submit checklist