Skip to content

test(extension-host): kill the host under a command with the default deadline - #6977

Merged
Hmbown merged 1 commit into
codewhale-hq:mainfrom
Lstarsky0:test/killed-host-command-default-deadline
Oct 14, 2026
Merged

Hmbown merged 1 commit into
codewhale-hq:mainfrom
Lstarsky0:test/killed-host-command-default-deadline

Conversation

@Lstarsky0

Copy link
Copy Markdown
Contributor

What and why

extension_host::tests::a_slow_command_is_cancelled_and_a_killed_host_fails_it_as_down has failed twice on windows-latest since 10-10, once on main:

timed out after 0s and was cancelled

The test runs both of its halves on one manager whose command_run_deadline is 300 ms. The first half needs that: it checks the deadline cancels a slow command. The second half starts a slow command, sleeps 100 ms, kills the host with taskkill and expects extension host is down: exited:. That leaves the kill 200 ms to land. When it takes longer, the command ends on its own deadline first, which is the message above.

The kill half now runs on a second manager from supervised_manager, which keeps the default 30 s command deadline, so the only thing that ends the command there is the host going away. The tool-side tests are already split this way (a_call_past_its_method_deadline_is_cancelled_and_the_host_stays_usable and killed_host_fails_calls_once_and_replays_with_fresh_owners). The first half is unchanged.

The comment about the kill landing inside the 300 ms deadline no longer describes anything, so it is removed.

Issue

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

How I tested it

  • To make the kill slow on purpose I made one scratch build that keeps the old test next to the new one and reads the sleep before the kill from an environment variable. At the normal 100 ms both pass 5 of 5. At 400 ms and at 2 s the old test fails 5 of 5 with the message above and the new one passes 5 of 5. None of that scratch code is in the diff.
  • 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: 15286 passed, none failed.

No new tests; this changes one existing test.

Checklist

  • One focused change, rebased on 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

…deadline

a_slow_command_is_cancelled_and_a_killed_host_fails_it_as_down runs both
halves on one manager whose command_run_deadline is 300 ms. The second
half starts a slow command, sleeps 100 ms, kills the host and expects
"extension host is down: exited:". That leaves the kill 200 ms to land.
On windows-latest taskkill has taken longer twice since 10-10, and the
command then ends on its own deadline instead:

    timed out after 0s and was cancelled

The kill half now runs on a second manager from supervised_manager, which
keeps the default 30 s command deadline, so the only thing that ends the
command there is the host going away. The tool tests are already split
this way (a_call_past_its_method_deadline_is_cancelled_and_the_host_stays_usable
and killed_host_fails_calls_once_and_replays_with_fresh_owners). The first
half is unchanged and still runs against the 300 ms deadline.

The comment about the kill landing inside the 300 ms deadline no longer
describes anything and is removed.

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

@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 14, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 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-14T05:30:07.646748Z 3411127 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.

@Hmbown
Hmbown merged commit 88b4c58 into codewhale-hq:main Oct 14, 2026
28 checks passed
@Hmbown

Hmbown commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

Thank you, @Lstarsky0, for separating the explicit 300 ms cancellation check from the killed-host check under the default 30 s command deadline. That preserves the host-down, restart identity, stale-generation refusal and fresh-echo assertions while removing the artificial deadline competition in the second half. Your PR has merged as its own work in 88b4c58dfb; the source branch is retained.

Exact PR-head CI completed with macOS 19,038 passed / 0 failed / 33 skipped, Ubuntu 19,035 / 0 / 34, Windows 18,304 passed (one existing browser-launcher leak) / 0 failed / 27 skipped, plus CI-flags Clippy and all ratchets. The changed fixture and owner-crash recovery passed on each native platform. This is verification of the PR source, not final installed-package or VM acceptance. It is carried toward 0.10.2, which has not shipped yet. Thank you for making the Windows coverage more useful without weakening the original cancellation assertions.

@Hmbown Hmbown added the windows Windows-specific behaviour label Oct 14, 2026
Hmbown pushed a commit that referenced this pull request Oct 15, 2026
Folds 26 main commits (incl. #6924 Runtime stores/workspace drivers, #6977,
#6943, #6959, #6958, #6956) into PR #6968's lane. The only conflicts were
web/data/agent-docs.generated.json and features.generated.json, regenerated
with web/scripts/derive-facts.mjs (check-facts OK, version 0.10.2).

Verified: scripts/dev-cargo.sh check --locked -p codewhale-tui --all-targets
finished in 9m00s with no errors. nextest -p codewhale-tui --lib on the overlap filter
(runtime_api|rlm::turn|runtime_threads|workspace_lease|snapshot):
902 passed, 0 failed, 14427 skipped (80.1s). Full suite left to hosted CI.

Branch exception: founder-authorized 2026-10-15 for this lane, recorded in
CW/coordination/BRANCH_EXCEPTIONS.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NBKbhx19BRbZtvWK8rVKjz
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 windows Windows-specific behaviour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants