Skip to content

test(shell): widen background completion wait#2528

Draft
cyq1017 wants to merge 1 commit into
Hmbown:mainfrom
cyq1017:codex/windows-shell-test-wait
Draft

test(shell): widen background completion wait#2528
cyq1017 wants to merge 1 commit into
Hmbown:mainfrom
cyq1017:codex/windows-shell-test-wait

Conversation

@cyq1017
Copy link
Copy Markdown
Contributor

@cyq1017 cyq1017 commented Jun 1, 2026

Problem

Change

  • Use one named 30s wait window for tests that assert a background shell eventually completes.
  • Leave shell manager/runtime behavior unchanged.

Verification

  • cargo test -p codewhale-tui test_background_execution --all-features --locked -- --nocapture
  • cargo test -p codewhale-tui test_completed_background_shell_releases_process_handles --all-features --locked -- --nocapture
  • cargo test -p codewhale-tui tools::shell::tests --all-features --locked -- --nocapture
  • cargo fmt --all -- --check
  • git diff --check

Refs #2525
Refs #2526

Greptile Summary

This PR widens the completion-wait timeout used in two background shell tests from 5 s to a named constant BACKGROUND_COMPLETION_WAIT_MS (30 s) to fix recurring Windows CI flakiness where the shell was still reported as Running when the 5 s window expired.

  • Introduces const BACKGROUND_COMPLETION_WAIT_MS: u64 = 30_000 and applies it to test_background_execution and test_completed_background_shell_releases_process_handles, replacing magic literals with a self-documenting name.
  • No shell manager or runtime code is changed; the fix is test-infrastructure only.

Confidence Score: 5/5

Safe to merge — changes are confined to test infrastructure with no production code touched.

The change replaces two hardcoded 5 s magic-number timeouts with a single named 30 s constant in test code only. Both affected tests exercise lightweight commands (echo and sleep 1 && echo) whose actual runtime is well under 30 s even on slow Windows runners, so the wider window eliminates the flakiness without making the tests meaninglessly long. No shell manager or runtime logic is modified.

No files require special attention.

Important Files Changed

Filename Overview
crates/tui/src/tools/shell/tests.rs Adds a named 30 s timeout constant and applies it to two background-completion waits that were failing on Windows CI with the previous 5 s limit.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Start background shell command] --> B[execute returns ShellStatus::Running]
    B --> C{Wait for completion\nup to BACKGROUND_COMPLETION_WAIT_MS\n30 000 ms}
    C -- completed in time --> D[Assert ShellStatus::Completed]
    C -- timed out --> E[Test fails: still Running]
    D --> F[Assert expected output / handle cleanup]
Loading

Reviews (1): Last reviewed commit: "test(shell): widen background completion..." | Re-trigger Greptile

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a constant BACKGROUND_COMPLETION_WAIT_MS set to 30,000 milliseconds in the shell tool tests, replacing hardcoded 5,000 millisecond timeouts in test_background_execution and test_completed_background_shell_releases_process_handles to allow more time for background tasks to complete. There are no review comments, and I have no feedback to provide.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant