Skip to content

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

Merged
Andriy Knysh (aknysh) merged 2 commits into
mainfrom
osterman/fix-pty-echo-test
Dec 18, 2025
Merged

Andriy Knysh (aknysh) merged 2 commits into
mainfrom
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

* 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 <[email protected]>

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

🤖 Generated with Claude Code

Co-Authored-By: Claude Haiku 4.5 <[email protected]>

* add tests, fix issues, add/update docs

* address comments, update docs

---------

Co-authored-by: Claude Haiku 4.5 <[email protected]>
Co-authored-by: Andriy Knysh <[email protected]>
Co-authored-by: aknysh <[email protected]>
@github-actions github-actions Bot added the size/xl Extra large size PR label Dec 18, 2025
@mergify

mergify Bot commented Dec 18, 2025

Copy link
Copy Markdown
Contributor

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

mergify Bot commented Dec 18, 2025

Copy link
Copy Markdown
Contributor

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

github-actions Bot commented Dec 18, 2025 •

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Files

None

@codecov

codecov Bot commented Dec 18, 2025 •

Copy link
Copy Markdown

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 Erik Osterman (Cloud Posse) (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
Andriy Knysh (aknysh) merged commit 47d0b2c into main Dec 18, 2025
@aknysh
Andriy Knysh (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