Repository navigation
Make fetch deadline test deterministic across platforms - #871
Conversation
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f5f21e3da
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Pause Tokio time in the placement-read test and advance it only after the injected read-entered signal, so pre-read scheduler delay does not consume the deadline. Assert virtual time is unchanged before entry.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
Motivation
The macOS run for #834 timed out after 45 minutes with 2,939 of 2,940 server tests complete. The neighboring green #838 run completed the same suite, and the Rust source was unchanged between those heads. The unfinished test was
a_fetch_whose_placement_read_stalls_is_timed_out_or_cancelledincrates/nessa-server/tests/conversation/leases.rs.The test used a FIFO to make
FilePlacements::placementblock in a synchronous read. Dropping the async fetch future cannot cancel that physical syscall, and cleanup relied on FIFO open/write timing. The logs identify the unfinished test but do not prove which macOS syscall was blocked. The FIFO setup came fromf334199ce9(#776).Solution
The test now injects a
ConversationPlacementsimplementation that delegates setup and erase to the real file store, then returns a pending future for armed reads and signals when each read starts. It asserts the typed timeout and caller-cancellation results, verifies no host ask occurred, and bounds each wait. This exercises the fetch service's async contract on every platform; it does not claim to cancel a physical filesystem read or fix a server product path.flowchart LR subgraph Before A[Fetch test] --> B[FIFO placement file] B --> C[Blocking filesystem read] C --> D[Timing-sensitive FIFO cleanup] end subgraph After E[Fetch test] --> F[Injected placement port] F --> G[Pending future and read-entered signal] G --> H[Deadline or caller cancellation] H --> I[Typed refusal; no host ask] endVerification
6608f4b16c23b177407d50c4ca41532fcc8ce1af: focused test passed, 1/1 in 0.12s.Instantis unchanged, then explicitly advances by the configured fetch wait.Instantassertion. Both temporary changes were restored.TimedOutinstead ofCancelled; service source was restored and its SHA matched the original.cargo fmt --all -- --check,git diff --check, andgit show --checkpassed. Fresh full review of this head was clean.6608f4bis pending.The test-only timing change addresses scheduler delay before the read-entry signal. The armed
PendingPlacementspath constructs but does not poll the underlying file-placement read. This does not claim to bound or cancel production filesystem syscalls.Summary by CodeRabbit