Repository navigation
fix: keep comfy and chat timing tests honest under load - #112
Merged
Merged
Conversation
wait_prompt cut each history poll's request timeout to whatever was left of the training deadline. When ComfyUI was too slow to answer the last poll in time, reqwest's own timeout fired first and the job failed with "error sending request for url (.../history/<id>)" instead of "training timed out". Under load the in-flight poll is the usual place the deadline lands, which is how a_graph_that_never_finishes_times_out failed. Polls now keep their own five-second request timeout and the whole poll runs under timeout_at(deadline), so whichever of the deadline or a real request failure comes first is reported as what it is. cancel_and_wait bounds its polls the same way. The timeout tests now mount a ComfyUI that marks the prompt terminal once it is cancelled, so they assert the cancellation was confirmed and no longer spend thirty seconds polling a graph that never ends. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
catalog_pages_all_references_without_exposing_result_bodies_or_other_chats acquired a 30-second lease and never renewed it, then made several hundred store round trips paging the catalog seven characters at a time. It takes about a second on its own, but with every test binary sharing one Postgres under load it took 39 seconds and the final delete_message failed with LeaseLost. Production never holds a lease without keep_alive (session.rs pairs every acquire with it), so the test now does the same and also asserts the renewal never lost the lease. What it asserts about paging, redaction, scoping and invalidation is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Clippy 1.98 flags Routing as a large enum: the Chat variant's Route makes every Routing at least 856 bytes, 216 more than the next largest variant, and clippy -D warnings fails zone_server on main. Boxing the route keeps the enum near the media variants' size; it is built once per turn, so the allocation costs nothing that matters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 1 minute. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Oct 5, 2026
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
A full verify run on a heavily loaded host (load average ~80, several workspaces compiling) failed two tests the PR under test never touched. One failure was a real bug; the other was a test that relied on the machine being fast.
zone_comfytrain::tests::a_graph_that_never_finishes_times_out: production bugwait_promptset each/historypoll's request timeout to whatever was left of the training deadline (min(remaining, 5s)).error sending request for url (…/history/<id>)instead oftraining timed out.cancel_and_waitpolling a mock graph that never ends.REQUEST_TIMEOUT, and the whole poll runs undertokio::time::timeout_at(deadline, …). If the deadline comes first, the job fails withtraining timed out. If a request fails before the deadline, that failure is reported.cancel_and_waitlimits its own polls to its deadline the same way.cleanup == true), and they no longer spend 30 s polling.zone_serverchat_context_store_tests::catalog_pages_all_references_without_exposing_result_bodies_or_other_chats: test-onlydelete_messagefailed withLeaseLost.services/chat/session.rspairs everyacquirewithkeep_alive. The store has no bug.keep_aliveguard like a generation does and asserts the lease was never lost. Its assertions about paging, redaction, chat and workspace scoping, and snapshot invalidation are unchanged.refactor(chat): box the route a chat turn carrieszone_serveronmainwithlarge_enum_variantonws::chat::Routing.migrate/sanitize,migrate/rmcpandmigrate/notify-email, with an identical diff, so whichever PR lands first leaves the others a no-op.Behaviour differences
ComfyUI training (
zone_comfy, regression testa_comfyui_too_slow_to_answer_still_times_out_at_the_deadline)training failed: training timed out. It used to fail withtraining failed: error sending request for url (…). Either way the prompt is cancelled and the run is cleaned up.error sending request for url (…)) a few milliseconds before the deadline.No other behaviour changes. The chat change is test-only, and the
Routingchange only boxes a field.Verification
a_comfyui_too_slow_to_answer_still_times_out_at_the_deadlinefails withtraining failed: error sending request for url (http://127.0.0.1:…/history/…), the same error as the original CI failure. With the fix it passes.cargo nextest run -p zone_comfy --no-default-features --lib train::: 47 passed (rerun after the review fixes, at the final HEAD).cargo nextest run -p zone_comfy --no-default-features --lib --stress-count 40 --test-threads 40over the fourwait_prompttiming tests: 40/40 iterations, 160 passes.zone-verify.sh … scoped - -- -p zone_server --test chat_context_store_tests --stress-count 5 --test-threads 10: 5/5 iterations, 125 passes, against a disposable Postgres.zone-verify.sh … scoped - -- -p zone_server --lib --test chat_context_store_tests --no-fail-fast --test-threads 8: 2974 passed, 40 skipped (zone_server lib tests, including the boxedRoutingtests, plus the store tests).cargo clippy -p zone_server -p zone_comfy --all-targets --no-default-features --features zone_context/test-utils -- -D warnings: clean at the final HEAD.cargo fmt --all --check: clean at the final HEAD.zone-verifyruns above came before the review fixes. Those fixes only refactor the ComfyUI code and test helpers and add an assertion message to the chat test, and the ComfyUI tests were rerun afterwards.Not verified:
readyworkspace run was not repeated; the verifier runs it.renewal_runs_independently_and_loss_wakes_cancellation.🤖 Generated with Claude Code