Skip to content

Fix race condition in PTY masking tests#1853

Merged
aknysh merged 1 commit intomainfrom
osterman/fix-pty-masking-test
Dec 10, 2025
Merged

Fix race condition in PTY masking tests#1853
aknysh merged 1 commit intomainfrom
osterman/fix-pty-masking-test

Conversation

@osterman
Copy link
Copy Markdown
Member

what

  • Fixed race condition in TestExecWithPTY_WithMasking and TestExecWithPTY_MaskingDisabled tests
  • Changed subprocess commands to add a brief sleep before exit, allowing PTY to read all buffered output
  • Improved error message in TestExecWithPTY_MaskingDisabled to show bytes for better debugging

why

These tests were failing intermittently due to Go issue #57141. When a subprocess exits immediately after writing to PTY, the PTY can receive EIO (end of input/output) before all buffered output is read. The sleep gives the PTY time to read the output before the subprocess exits.

references

The tests were failing due to a subprocess exiting too quickly, causing the
PTY to receive EIO (end of input/output) before buffered output could be read.
Added sleep to give PTY time to read output, per Go issue #57141.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@osterman osterman requested a review from a team as a code owner December 10, 2025 14:33
@github-actions github-actions bot added the size/s Small size PR label Dec 10, 2025
@github-actions
Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Files

None

@osterman osterman added the no-release Do not create a new release (wait for additional code changes) label Dec 10, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Dec 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.12%. Comparing base (448d405) to head (3460596).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1853   +/-   ##
=======================================
  Coverage   73.11%   73.12%           
=======================================
  Files         550      550           
  Lines       53168    53168           
=======================================
+ Hits        38873    38878    +5     
+ Misses      11439    11435    -4     
+ Partials     2856     2855    -1     
Flag Coverage Δ
unittests 73.12% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aknysh aknysh merged commit 0a2c722 into main Dec 10, 2025
63 of 64 checks passed
@aknysh aknysh deleted the osterman/fix-pty-masking-test branch December 10, 2025 14:54
@github-actions
Copy link
Copy Markdown

These changes were released in v1.203.0-test.1.

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

Labels

no-release Do not create a new release (wait for additional code changes) size/s Small size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants