test: harden cross-platform deadline regressions - #267
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR hardens deadline-sensitive test fixtures across the storage and runtime subsystems to reduce cross-platform flakiness (notably on macOS hosted runners) while keeping the underlying deadline contracts meaningful. The updates widen the separation between “slow provider” behavior and assertion bounds, and replace one elapsed-time assertion with direct WAL durability state checks.
Changes:
- Increased injected provider delays / callback budgets and relaxed elapsed-time assertions to tolerate scheduler variance while still catching budget-regression behavior.
- Updated hybrid storage proof/publication deadline tests to use larger shared budgets and callback timeouts with clear “headroom” comments.
- Reworked the strict WAL seal deadline test to assert WAL state invariants (no flush / no durability advancement) instead of relying on wall-clock elapsed time.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/storage/hybrid/backend/tests.rs | Widens callback timeouts and assertion bounds for guarded delete batching and shared-deadline proof/publication tests. |
| src/storage/cloud/mod.rs | Makes mocked cloud backend callbacks deliberately slow (1s) and relaxes adapter timeout assertions to be scheduler-tolerant. |
| src/runtime/event_loop/cloud_integration/tests.rs | Broadens injected delays and runtime response budgets; replaces one strict WAL seal elapsed-time assertion with direct durability/WAL state assertions. |
| src/config/cloud_validation.rs | Widens the slow-path fixture delay and relaxes the preflight bounded-time assertion for cross-platform variance. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
7 tasks
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
Harden deadline-sensitive test fixtures and assertions that were exposed as flaky on the first post-merge macOS Platform run after PR #266. The tests now preserve a wide separation between the production deadline, the deliberately slow provider response, and the scheduler-tolerant assertion bound.
One strict WAL seal test replaces a wall-clock assertion with direct state assertions proving that refusal does not flush the active WAL or advance durability.
Why are you making this contribution?
The Platform run at https://github.com/cntryl/midge/actions/runs/33523992771 reported seven deadline-regression failures on macOS while the same code passed on Windows and on the next combined main run. The original margins were too narrow for loaded cross-platform hosted runners and could obscure real regressions with scheduler noise.
Linked issues
No issue: this is a test-only follow-up to the post-merge Platform failure after PR #266.
Acceptance audit
Evidence: The deliberately slow callbacks are now at least one second while bounded assertions remain at or below 500 milliseconds, or use a 500 millisecond shared deadline with a one-second assertion ceiling.
Production entry point: Cloud read, HEAD, CAS, WAL prune and seal, metadata publication, SST publication, guarded deletion, shutdown, and cloud preflight deadline paths.
Resolution: Preserve the original deadline contracts with materially wider fixture-to-assertion separation and deterministic durability-state assertions where elapsed time was unnecessary.
Risk and compatibility
Low risk. This PR changes test code only. It does not change production behavior, persistence formats, cloud protocols, or public APIs.
Verification
Tool assistance disclosure
Codex inspected the failed hosted run, identified the shared narrow-margin pattern, updated the test fixtures and assertions, and ran the reported verification.
Contributor responsibility