Skip to content

fix: remove wall-clock-timing races from performance_agent_integration tests - #6688

Merged
bug-ops merged 1 commit into
mainfrom
fix/6687-flaky-agent-integration-timing
Jul 28, 2026
Merged

fix: remove wall-clock-timing races from performance_agent_integration tests#6688
bug-ops merged 1 commit into
mainfrom
fix/6687-flaky-agent-integration-timing

Conversation

@bug-ops

@bug-ops bug-ops commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • agent_integration_with_safe_bash_blocks asserted elapsed.as_millis() < 1000 around a fully-mocked Agent::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_blocks had 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.
  • Both timing assertions are dropped; the assertions that carry real signal remain: tool dispatch count (assert_eq!(executor.get_call_count(), ...)) and that the tool result actually reached the output channel.
  • A genuine hang is not caught by nextest's slow-timeout (warn-only, no terminate-after configured) — the real backstop is CI's job-level timeout-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-core unit tests), but a separate top-level integration test file that PR did not touch.

Closes #6687

Test plan

  • cargo +nightly fmt --check
  • cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings
  • cargo 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

…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.
@github-actions github-actions Bot added bug Something isn't working size/S Small PR (11-50 lines) documentation Improvements or additions to documentation tests Test-related changes labels Jul 28, 2026
@bug-ops
bug-ops merged commit b4d91d4 into main Jul 28, 2026
23 checks passed
@bug-ops
bug-ops deleted the fix/6687-flaky-agent-integration-timing branch July 28, 2026 12:20
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation size/S Small PR (11-50 lines) tests Test-related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

agent_integration_with_safe_bash_blocks flaky on CI: fixed 1000ms wall-clock threshold

1 participant