Skip to content

Fix flaky PTY tests with sh -c and printf#1890

Merged
aknysh merged 2 commits intomainfrom
osterman/fix-pty-echo-test
Dec 18, 2025
Merged

Fix flaky PTY tests with sh -c and printf#1890
aknysh merged 2 commits intomainfrom
osterman/fix-pty-echo-test

Conversation

@osterman
Copy link
Copy Markdown
Member

what

  • Fixed flaky PTY tests TestExecWithPTY_BasicExecution and TestExecWithPTY_DefaultOptions
  • Replaced direct echo command with sh -c using printf for more reliable output handling
  • Added a small sleep to ensure PTY has time to read buffered output before subprocess exit

why

The flaky tests were failing intermittently because the direct echo command doesn't reliably output through the PTY in all environments. Using sh -c with printf and a brief sleep resolves the race condition that occurs when the subprocess exits before all output is read from the PTY.

references

  • https://go.dev/issue/57141 - PTY race condition documentation
  • Tests now match the pattern already used in TestExecWithPTY_WithMasking and TestExecWithPTY_MaskingDisabled

* feat: Add file-scoped locals to stack configurations

Implements file-scoped locals for Atmos stack manifests, similar to Terraform and Terragrunt. Locals enable temporary variables that are available within a single file with dependency resolution and circular dependency detection.

Key features:
- Locals defined at global, component-type, and component scopes
- Dependency resolution using topological sorting
- Circular dependency detection with clear error messages
- File-scoped isolation (no inheritance across imports)
- Integration with describe locals command with provenance tracking

Includes comprehensive test scenarios and documentation.

🤖 Generated with Claude Code

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix: Correct broken links in file-scoped locals blog post

🤖 Generated with Claude Code

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* add tests, fix issues, add/update docs

* address comments, update docs

---------

Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: Andriy Knysh <aknysh@users.noreply.github.com>
Co-authored-by: aknysh <andriy.knysh@gmail.com>
@osterman osterman requested a review from a team as a code owner December 18, 2025 04:32
@github-actions github-actions bot added the size/xl Extra large size PR label Dec 18, 2025
@mergify
Copy link
Copy Markdown

mergify bot commented Dec 18, 2025

Warning

This PR exceeds the recommended limit of 1,000 lines.

Large PRs are difficult to review and may be rejected due to their size.

Please verify that this PR does not address multiple issues.
Consider refactoring it into smaller, more focused PRs to facilitate a smoother review process.

@mergify
Copy link
Copy Markdown

mergify bot commented Dec 18, 2025

Important

Cloud Posse Engineering Team Review Required

This pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes.

To expedite this process, reach out to us on Slack in the #pr-reviews channel.

@mergify mergify bot added the needs-cloudposse Needs Cloud Posse assistance label Dec 18, 2025
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 18, 2025

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Files

None

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.18%. Comparing base (3840735) to head (53779f4).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1890      +/-   ##
==========================================
- Coverage   73.19%   73.18%   -0.01%     
==========================================
  Files         609      609              
  Lines       56766    56766              
==========================================
- Hits        41548    41547       -1     
+ Misses      12297    12296       -1     
- Partials     2921     2923       +2     
Flag Coverage Δ
unittests 73.18% <ø> (-0.01%) ⬇️

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

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

@osterman osterman added the no-release Do not create a new release (wait for additional code changes) label Dec 18, 2025
@github-actions github-actions bot added size/xs Extra small size PR and removed size/xl Extra large size PR labels Dec 18, 2025
@aknysh aknysh merged commit 47d0b2c into main Dec 18, 2025
56 checks passed
@aknysh aknysh deleted the osterman/fix-pty-echo-test branch December 18, 2025 06:02
@mergify mergify bot removed the needs-cloudposse Needs Cloud Posse assistance label Dec 18, 2025
@github-actions
Copy link
Copy Markdown

These changes were released in v1.202.0.

@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/xs Extra small size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants