Skip to content

test: harden cross-platform deadline regressions - #267

Merged
smiggleworth merged 1 commit into
mainfrom
test/harden-platform-deadline-regressions
Sep 1, 2026
Merged

test: harden cross-platform deadline regressions#267
smiggleworth merged 1 commit into
mainfrom
test/harden-platform-deadline-regressions

Conversation

@smiggleworth

Copy link
Copy Markdown
Contributor

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

  • Criterion: Deadline regressions remain behaviorally meaningful while tolerating cross-platform scheduler variance.
    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

  • cargo test --workspace --all-features
  • cargo clippy --workspace --all-targets --all-features -- -D warnings -D clippy::pedantic
  • cargo fmt --check
  • cntryl-tools validate-tests: 2579 of 2579 tests compliant
  • Focused deadline regression set: all 16 selected tests passed
  • git diff --cached --check

Tool assistance disclosure

  • AI or another generative tool materially assisted this contribution.

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

  • I understand the complete change and can explain or revise it.
  • I reviewed the complete diff.
  • I reported validation accurately and did not claim checks I did not run.
  • I disclosed material generated assistance.
  • I have the right to submit this work under the repository license.

Copilot AI lite review requested due to automatic review settings September 1, 2026 15:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@smiggleworth
smiggleworth merged commit 2115f5d into main Sep 1, 2026
5 checks passed
@smiggleworth
smiggleworth deleted the test/harden-platform-deadline-regressions branch September 1, 2026 15:43
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.

2 participants