fix: remove wall-clock-timing races from performance_agent_integration tests - #6688
Merged
Merged
Conversation
…n tests agent_integration_with_safe_bash_blocks asserted elapsed < 1000ms around a fully-mocked Agent::run() call and intermittently failed under CI load. agent_integration_no_bash_blocks had the same anti-pattern (already widened once for this exact class, 500ms -> 2000ms, issue #3649) with insufficient headroom against observed failure times. Drop both timing assertions and keep the assertions that carry real signal: tool dispatch count and that the tool result reached the output channel.
6 tasks
bug-ops
added a commit
that referenced
this pull request
Jul 28, 2026
agent_throughput_multiple_responses asserted elapsed < 10s around a fully-mocked Agent::run() call, the same anti-pattern already fixed for its two sibling tests in this file (#6687/PR #6688). Drop the timing assertion, keep the structural outputs.len() >= 5 check. tool_executor_overhead_is_minimal timed Instant::now()/.elapsed() around two adjacent statements with no work between them, so its < 10ms assertion passed unconditionally, and its if-let guard meant the assertion was silently skipped whenever the tool call never fired. Real dispatch-overhead coverage already exists in tool_executor_pattern_matching_overhead (drives the production ShellExecutor). Replace the vacuous timing check with assert_eq!(executor.get_call_count(), 1), matching the unconditional load-bearing-dispatch pattern already used by agent_integration_with_safe_bash_blocks in this file, and remove the now dead execution_time/get_execution_time() machinery.
bug-ops
added a commit
that referenced
this pull request
Jul 28, 2026
#6694) agent_throughput_multiple_responses asserted elapsed < 10s around a fully-mocked Agent::run() call, the same anti-pattern already fixed for its two sibling tests in this file (#6687/PR #6688). Drop the timing assertion, keep the structural outputs.len() >= 5 check. tool_executor_overhead_is_minimal timed Instant::now()/.elapsed() around two adjacent statements with no work between them, so its < 10ms assertion passed unconditionally, and its if-let guard meant the assertion was silently skipped whenever the tool call never fired. Real dispatch-overhead coverage already exists in tool_executor_pattern_matching_overhead (drives the production ShellExecutor). Replace the vacuous timing check with assert_eq!(executor.get_call_count(), 1), matching the unconditional load-bearing-dispatch pattern already used by agent_integration_with_safe_bash_blocks in this file, and remove the now dead execution_time/get_execution_time() machinery.
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
agent_integration_with_safe_bash_blocksassertedelapsed.as_millis() < 1000around a fully-mockedAgent::run()call and intermittently failed under CI load (observed 1.247s/1.610s on PR fix(sanitizer): redact PEM key bodies and no-prefix AWS secrets #6678).agent_integration_no_bash_blockshad the identical anti-pattern (elapsed.as_millis() < 2000), already widened once for this exact flake class (500ms -> 2000ms, issue fix(build,tools): add testing to full feature; fix DynExecutor::requires_confirmation delegation #3649) with insufficient headroom against the observed failure times, so widening again was ruled out as a proven non-fix.assert_eq!(executor.get_call_count(), ...)) and that the tool result actually reached the output channel.slow-timeout(warn-only, noterminate-afterconfigured) — the real backstop is CI's job-leveltimeout-minutes: 10, which the comment/CHANGELOG now describe accurately instead of the previous incorrect claim about a per-test nextest timeout.Same defect class as issue #6679 (fixed by PR #6685 for 3
zeph-coreunit tests), but a separate top-level integration test file that PR did not touch.Closes #6687
Test plan
cargo +nightly fmt --checkcargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warningscargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins(15155 passed, 36 skipped)cargo nextest run --config-file .github/nextest.toml -p zeph --test performance_agent_integration(13/13 passed, both fixed tests run 10x+ each during development with no flakes)RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"gitleaks protect --staged --no-banner --redact