Repository navigation
Conversation
Closes warpdotdev#13979 test_metadata_after_trash_item_failure and test_cloud_pref_not_synced_when_current_value_not_syncable used a fixed real-time Timer::after wait as their only synchronization before asserting on async state. Under contended/parallel test runs, the wall-clock time for the awaited work to actually complete can exceed the fixed budget even though the retry backoff itself is short, making both load-sensitive. Replace the fixed 10s "wait for retries to exhaust" sleep in the first test with a poll loop on trashed_ts, and drop the fixed 1s sleep before the second test's existing await_spawned_futures poll loop (which already retries for up to 5s).
The wait_for_trashed_status_for_object helper expressed its ceiling as a fixed for _ in 0..300 iteration count, which encodes 30s only indirectly and would drift if the per-iteration cost changed. Wrap the poll in with_timeout(30s) so the ceiling is a stated Duration, and name the ceiling and interval as constants. The comment now states only facts: what is awaited, that the condition cannot change until the retry backoff elapses, and that this async stack exposes no awaitable model-update signal a test can subscribe to (await_spawned_future resolves on a single spawned hop, not the delayed-respawn retry cascade), so a bounded poll is the reachable primitive.
|
Note: this is right on the bubble for me in terms of which approach is correct / best matches the style / concurrency practices in this repo. I don't love that it is a sleeping loop, but I think it's safer with this implementation. I'd love to hear what a maintainer thinks about this approach. |
|
Every PR must be linked to a same-repo issue before Oz can review it. This PR is linked to #13979, but no linked issue is marked See the contribution guidelines for the full readiness model. Powered by Oz |
There was a problem hiding this comment.
Every PR must be linked to a same-repo issue before Oz can review it.
This PR is linked to #13979, but no linked issue is marked ready-to-implement yet. Only repository maintainers apply that label, so please wait for a maintainer to mark the issue. Once it is marked, push a new commit or comment /oz-review to re-trigger review.
See the contribution guidelines for the full readiness model.
Powered by Oz
|
Hi @fbartho — a reviewer requested changes on this PR and it hasn't had activity from you in 7 days. When you get a chance, please push updates or reply to the review so a reviewer can take another look. Without activity, this PR will be automatically closed after 14 days of inactivity. |
|
(Just commenting so stale-bot doesn't think this is dead). |
|
/oz-review |
|
I'm re-reviewing this pull request in response to a review request. You can view the conversation on Warp. I reviewed this pull request and requested human review from: Comment Powered by Oz |
Oz no longer requests changes for this pull request after the latest automated review.
There was a problem hiding this comment.
Overview
This PR replaces fixed timer sleeps in two async tests with condition-based waiting or an existing polling helper. The changes are test-only and preserve bounded waits while reducing load-sensitive flakiness.
Concerns
- No blocking concerns found.
Verdict
Found: 0 critical, 0 important, 0 suggestions
Approve
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
|
@seemeroland the PR is approved, but I don't have a merge button, is that something you need to do? or what should I do to get this merged? Thanks! |
|
@oss-maintainers — This was approved but not merged. Would you like anything else? |
Wraps a multi-method chain in the trashed-status poll helper to satisfy cargo fmt.
Head branch was pushed to by a user without write access
Closes #13979
Mechanism
Two tests used a fixed real-time
Timer::afterwait as their sole synchronization step before asserting on async state.Timeris a real OS-backed timer (async_io::Timer), not a virtual clock — under full-parallel suite load, the awaited async work can take longer than the fixed sleep budget even though the timer itself fires on schedule. That makes the failures load-sensitive and intermittent: they depend on contention at run time, not process-global state (unlike the sibling flake clusters #13972–#13975, which are all global-state races).Correction to the ticket
The ticket names
test_pending_metadata_update_with_pollingat line 2601 — on current master that function contains noTimer::after; line 2601 is where its signature begins. The quoted 10s wait lives at line 2578 inside the immediately-preceding test,test_metadata_after_trash_item_failure, whose code matches the ticket's described mechanism and snippet exactly. This PR fixes that test. (Also noted on the issue.)Changes
test_metadata_after_trash_item_failure(update_manager_tests.rs): the fixed 10s "wait for retries to exhaust" sleep is nowwait_for_trashed_status_for_object(): a condition poll onmetadata().trashed_tswrapped in the repo's ownwith_timeoutprimitive with a named 30sDurationceiling — the deadline is stated directly rather than encoded as an iteration count. Polling is the reachable primitive here:await_spawned_futureresolves a single spawned hop and cannot follow the retry cascade (each backoff re-spawns a fresh future whose handle is discarded), and the model-update event at the clear site is callback-based with no awaitable bridge; the sibling helperwait_for_num_spawned_futureswaits the same way.test_cloud_pref_not_synced_when_current_value_not_syncable(cloud_preferences_syncer_tests.rs): removed a fixed 1s sleep immediately beforeawait_spawned_futures(…), which already polls with a 5s ceiling; the awaited futures are spawned synchronously earlier in the test, so the extra fixed wait was redundant.Stability evidence
test_metadata_after_trash_item_failure: 30/30 in a standalone loop (~3.6s each — the retry backoff itself still has to elapse; polling replaces only the fixed ceiling).test_cloud_pref_not_synced_when_current_value_not_syncable: 30/30, ~0.14–0.53s each (faster now that the redundant wait is gone).cargo nextest run -p warp: 5792/5792 passed.cargo build -p warp --tests+cargo clippy -p warp --lib --tests: zero warnings.Testing
./script/runAgent Mode