Skip to content

Fix off-by-one error trimming barrier sequences from exit test output streams.#1694

Merged
grynspan merged 1 commit into
mainfrom
jgrynspan/1693-exit-test-off-by-one-barrier
Apr 28, 2026
Merged

Fix off-by-one error trimming barrier sequences from exit test output streams.#1694
grynspan merged 1 commit into
mainfrom
jgrynspan/1693-exit-test-off-by-one-barrier

Conversation

@grynspan

Copy link
Copy Markdown
Contributor

If the only thing in the stdout or stderr stream of an exit test's child process is the barrier sequence (i.e. exactly those 32 bytes and nothing else), we fail to trim it off. Fix it.

Resolves #1693.

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

… streams.

If the _only_ thing in the `stdout` or `stderr` stream of an exit test's child
process is the barrier sequence (i.e. exactly those 32 bytes and nothing else),
we fail to trim it off. Fix it.

Resolves #1693.
@grynspan grynspan added this to the Swift 6.4.0 (main) milestone Apr 28, 2026
@grynspan grynspan self-assigned this Apr 28, 2026
@grynspan grynspan added bug 🪲 Something isn't working exit-tests ☠️ Work related to exit tests labels Apr 28, 2026

@dimitribouniol dimitribouniol left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Here's my emotional-support Approval 😛

@grynspan grynspan merged commit 7de99fb into main Apr 28, 2026
35 checks passed
@grynspan grynspan deleted the jgrynspan/1693-exit-test-off-by-one-barrier branch April 28, 2026 17:13
grynspan added a commit that referenced this pull request Apr 28, 2026
… streams. (#1694)

If the _only_ thing in the `stdout` or `stderr` stream of an exit test's
child process is the barrier sequence (i.e. exactly those 32 bytes and
nothing else), we fail to trim it off. Fix it.

Resolves #1693.

### Checklist:

- [x] Code and documentation should follow the style of the [Style
Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md).
- [x] If public symbols are renamed or modified, DocC references should
be updated.
grynspan added a commit that referenced this pull request Apr 28, 2026
…t output streams. (#1695)

- **Explanation**: Fixes an off-by-one error that can corrupt output
from exit tests.
- **Scope**: Exit tests.
- **Issues**: #1693
- **Original PRs**: #1694
- **Risk**: Low
- **Testing**: New unit test.
- **Reviewers**: @stmontgomery @dimitribouniol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🪲 Something isn't working exit-tests ☠️ Work related to exit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exit tests with no output produce barrier value

3 participants