Skip to content

test(runtime-chat): give the refused admission 30 s instead of 1 s - #6982

Open
Lstarsky0 wants to merge 1 commit into
codewhale-hq:mainfrom
Lstarsky0:test/relay-admission-bound
Open

Lstarsky0 wants to merge 1 commit into
codewhale-hq:mainfrom
Lstarsky0:test/relay-admission-bound

Conversation

@Lstarsky0

Copy link
Copy Markdown
Contributor

What and why

runtime_chat_relay::tests::active_participant_rejects_new_and_exact_replay_without_blocking_or_starting failed on windows-latest on main at a8e3281:

Runtime Chat admission must not deadlock behind the UI-owned writer: Elapsed(())

The test gives each apply_prompt call 1 s to come back with "active local provider work". Before it refuses, apply_prompt creates the native thread, writes the binding and a turn reservation to disk with write_atomic, and then writes the reservation's release. On windows-latest the whole test usually takes 0.2-0.4 s, but in 5 of 18 passing runs since 10-13 it took 1.1-3.8 s (it passed in 3.76 s on https://github.com/codewhale-hq/Codewhale/actions/runs/38433637142, for example), so the 1 s bound has very little room left.

The refusal itself never waits: try_ensure_inference_ownership only tries to take the lease. The bound is there to catch a deadlock, and 30 s still does. That is the same 30 s bound the subagent approval tests use for the same kind of check (#6966).

Issue

No-Issue: Windows CI flake, no issue filed for it

How I tested it

  • CPU load alone doesn't reproduce it here: 0 of 80 runs failed next to 60 busy loops, each run about 0.1 s. Slow syncs do. I put the test's temp dir on an external disk and kept six processes rewriting a 32 MB file there with F_FULLFSYNC, so the test's own syncs wait behind them. With the 1 s bound, 22 of 43 runs failed with the Elapsed(()) above (the test took 2.1-6.3 s). With 30 s, none of 101 runs failed (2.6-4.0 s). On an idle machine both pass in about 0.1 s.
  • cargo fmt --all -- --check, cargo clippy -p codewhale-tui --all-targets --all-features with CI's flags, and cargo check -p codewhale-tui --all-targets: clean. Clippy also on 1.99, plus cargo +1.89.0 check -p codewhale-tui.
  • cargo nextest run -p codewhale-tui --lib: 15304 passed, none failed.

No new tests; this changes one bound in an existing one.

Checklist

  • One focused change, on 88b4c58; it merges cleanly into current main
  • cargo fmt --all passes, and tests cover new or changed behavior
  • If this adds or changes a user-facing feature, I updated its docs and its row in docs/features.toml (cargo test -p codewhale-tui --test feature_registry checks it) — n/a

active_participant_rejects_new_and_exact_replay_without_blocking_or_starting
gives each apply_prompt call 1 s to come back with "active local
provider work". Before it refuses, apply_prompt creates the native
thread, writes the binding and a turn reservation to disk with
write_atomic, and then writes the reservation's release. On
windows-latest the whole test normally takes 0.2-0.4 s, but it took
1.1-3.8 s in 5 of 18 passing runs since 10-13, and on main at a8e3281
one call went past the second:

    Runtime Chat admission must not deadlock behind the UI-owned writer: Elapsed(())

The refusal itself never waits: try_ensure_inference_ownership only
tries to take the lease. The bound is there to catch a deadlock, and
30 s still does. It is the same 30 s bound the subagent approval tests
use for the same kind of check.

Signed-off-by: Lstarsky0 <59827030+Lstarsky0@users.noreply.github.com>
@Lstarsky0
Lstarsky0 requested a review from Hmbown as a code owner October 15, 2026 04:22

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@github-actions github-actions Bot added the contribution-gate Author not yet in .github/APPROVED_CONTRIBUTORS; a maintainer grants access with /lgtm label Oct 15, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T04:25:14.519305Z 6276fed PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution-gate Author not yet in .github/APPROVED_CONTRIBUTORS; a maintainer grants access with /lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant