Skip to content

Comments

Fix integration tests hanging on machines with a TTY#414

Merged
khaong merged 1 commit intomainfrom
alex/investigate-test-hang
Feb 18, 2026
Merged

Fix integration tests hanging on machines with a TTY#414
khaong merged 1 commit intomainfrom
alex/investigate-test-hang

Conversation

@khaong
Copy link
Contributor

@khaong khaong commented Feb 18, 2026

Summary

  • After fix flaky test #404 moved detectOrSelectAgent to the command handler, integration tests calling entire enable --strategy now hit the interactive agent selection form when a real TTY is available, causing hangs
  • Sets ENTIRE_TEST_TTY=0 in cliEnv() so all CLI subprocesses skip the TTY check by default
  • Tests that need TTY simulation (hook tests) already override this per-subprocess with ENTIRE_TEST_TTY=1

Test plan

  • mise run fmt && mise run lint passes
  • mise run test:ci passes (unit + integration)
  • Verified all ENTIRE_TEST_TTY=1 usages are on per-subprocess env, not via cliEnv()

🤖 Generated with Claude Code

After #404 moved detectOrSelectAgent to the command handler, integration
tests calling `entire enable --strategy` now hit the interactive agent
selection form when a real TTY is available. Set ENTIRE_TEST_TTY=0 in
cliEnv() so all CLI subprocesses skip the TTY check by default. Tests
that need TTY simulation already override this per-subprocess.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 6e19340bc0c8
@khaong khaong requested a review from a team as a code owner February 18, 2026 23:24
Copilot AI review requested due to automatic review settings February 18, 2026 23:24
@cursor
Copy link

cursor bot commented Feb 18, 2026

PR Summary

Low Risk
Test-only environment change that reduces flakiness by avoiding interactive prompts; low risk outside integration test behavior.

Overview
Prevents integration tests from hanging on machines with a real TTY by forcing non-interactive behavior for all CLI subprocesses.

TestEnv.cliEnv() now always sets ENTIRE_TEST_TTY=0, ensuring commands that would otherwise prompt (e.g., agent selection) take the no-TTY path; tests that need TTY behavior can still override this per subprocess.

Written by Cursor Bugbot for commit 8253d4b. Configure here.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a regression introduced in PR #404 where integration tests would hang on machines with a real TTY. After PR #404 moved detectOrSelectAgent to the enable command handler, tests calling entire enable --strategy started hitting the interactive agent selection form when running on machines with a TTY available, causing the tests to block indefinitely.

Changes:

  • Sets ENTIRE_TEST_TTY=0 in the default test environment to prevent interactive prompts from blocking tests
  • Tests that specifically need TTY simulation (like hook tests) already override this per-subprocess with ENTIRE_TEST_TTY=1

@khaong khaong enabled auto-merge February 18, 2026 23:31
@khaong khaong merged commit 6705e0a into main Feb 18, 2026
10 checks passed
@khaong khaong deleted the alex/investigate-test-hang branch February 18, 2026 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants