Skip to content

[CI] Fix flaky SIGPIPE in backwards_compat test - #179999

Closed
huydhn wants to merge 20 commits into
gh/huydhn/28/basefrom
gh/huydhn/28/head
Closed

huydhn wants to merge 20 commits into
gh/huydhn/28/basefrom
gh/huydhn/28/head

Conversation

@huydhn

@huydhn huydhn commented Apr 10, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

The check_public_api_test_fails function in test.sh uses
echo "${test_output}" | grep -q to verify that the canary module was
detected. Under -o pipefail (set by the GHA shell), this is a race
condition: grep -q exits immediately on first match, but echo may
still be writing the large test output (~hundreds of lines of import
tracebacks), receiving SIGPIPE (exit 141). With pipefail, the pipeline
returns 141 instead of grep's 0, so the script incorrectly concludes the
canary wasn't found.

Replace the pipe with a here-string (grep -q ... <<< "$var"), which
passes content via a temporary file rather than a pipe, eliminating the
SIGPIPE race entirely.

Fixes flaky failures like:
https://github.com/pytorch/pytorch/actions/runs/24216395495/job/70700891103

Testing

https://github.com/pytorch/pytorch/actions/runs/24262053518/job/70850088090?pr=179999

Authored with Claude.

[ghstack-poisoned]
@huydhn
huydhn requested a review from a team as a code owner April 10, 2026 19:49
@pytorch-bot

pytorch-bot Bot commented Apr 10, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/179999

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 765e32b with merge base 278936a (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot

pytorch-bot Bot commented Apr 10, 2026

Copy link
Copy Markdown

This PR needs a release notes: label

If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

huydhn added a commit that referenced this pull request Apr 10, 2026
The `check_public_api_test_fails` function in test.sh uses
`echo "${test_output}" | grep -q` to verify that the canary module was
detected. Under `-o pipefail` (set by the GHA shell), this is a race
condition: `grep -q` exits immediately on first match, but `echo` may
still be writing the large test output (~hundreds of lines of import
tracebacks), receiving SIGPIPE (exit 141). With `pipefail`, the pipeline
returns 141 instead of grep's 0, so the script incorrectly concludes the
canary wasn't found.

Replace the pipe with a here-string (`grep -q ... <<< "$var"`), which
passes content via a temporary file rather than a pipe, eliminating the
SIGPIPE race entirely.

Fixes flaky failures like:
https://github.com/pytorch/pytorch/actions/runs/24216395495/job/70700891103

Authored with Claude.


ghstack-source-id: 1efad1c
Pull-Request: #179999
@huydhn huydhn added topic: not user facing topic category labels Apr 10, 2026
[ghstack-poisoned]
huydhn added a commit that referenced this pull request Apr 10, 2026
The `check_public_api_test_fails` function in test.sh uses
`echo "${test_output}" | grep -q` to verify that the canary module was
detected. Under `-o pipefail` (set by the GHA shell), this is a race
condition: `grep -q` exits immediately on first match, but `echo` may
still be writing the large test output (~hundreds of lines of import
tracebacks), receiving SIGPIPE (exit 141). With `pipefail`, the pipeline
returns 141 instead of grep's 0, so the script incorrectly concludes the
canary wasn't found.

Replace the pipe with a here-string (`grep -q ... <<< "$var"`), which
passes content via a temporary file rather than a pipe, eliminating the
SIGPIPE race entirely.

Fixes flaky failures like:
https://github.com/pytorch/pytorch/actions/runs/24216395495/job/70700891103

Authored with Claude.


ghstack-source-id: e7d5686
Pull-Request: #179999
[ghstack-poisoned]
huydhn added a commit that referenced this pull request Apr 10, 2026
The `check_public_api_test_fails` function in test.sh uses
`echo "${test_output}" | grep -q` to verify that the canary module was
detected. Under `-o pipefail` (set by the GHA shell), this is a race
condition: `grep -q` exits immediately on first match, but `echo` may
still be writing the large test output (~hundreds of lines of import
tracebacks), receiving SIGPIPE (exit 141). With `pipefail`, the pipeline
returns 141 instead of grep's 0, so the script incorrectly concludes the
canary wasn't found.

Replace the pipe with a here-string (`grep -q ... <<< "$var"`), which
passes content via a temporary file rather than a pipe, eliminating the
SIGPIPE race entirely.

Fixes flaky failures like:
https://github.com/pytorch/pytorch/actions/runs/24216395495/job/70700891103

Authored with Claude.


ghstack-source-id: 4fd18a6
Pull-Request: #179999
[ghstack-poisoned]
huydhn added a commit that referenced this pull request Apr 10, 2026
The `check_public_api_test_fails` function in test.sh uses
`echo "${test_output}" | grep -q` to verify that the canary module was
detected. Under `-o pipefail` (set by the GHA shell), this is a race
condition: `grep -q` exits immediately on first match, but `echo` may
still be writing the large test output (~hundreds of lines of import
tracebacks), receiving SIGPIPE (exit 141). With `pipefail`, the pipeline
returns 141 instead of grep's 0, so the script incorrectly concludes the
canary wasn't found.

Replace the pipe with a here-string (`grep -q ... <<< "$var"`), which
passes content via a temporary file rather than a pipe, eliminating the
SIGPIPE race entirely.

Fixes flaky failures like:
https://github.com/pytorch/pytorch/actions/runs/24216395495/job/70700891103

Authored with Claude.


ghstack-source-id: 6b3fde2
Pull-Request: #179999
[ghstack-poisoned]
huydhn added a commit that referenced this pull request Apr 10, 2026
The `check_public_api_test_fails` function in test.sh uses
`echo "${test_output}" | grep -q` to verify that the canary module was
detected. Under `-o pipefail` (set by the GHA shell), this is a race
condition: `grep -q` exits immediately on first match, but `echo` may
still be writing the large test output (~hundreds of lines of import
tracebacks), receiving SIGPIPE (exit 141). With `pipefail`, the pipeline
returns 141 instead of grep's 0, so the script incorrectly concludes the
canary wasn't found.

Replace the pipe with a here-string (`grep -q ... <<< "$var"`), which
passes content via a temporary file rather than a pipe, eliminating the
SIGPIPE race entirely.

Fixes flaky failures like:
https://github.com/pytorch/pytorch/actions/runs/24216395495/job/70700891103

Authored with Claude.


ghstack-source-id: 915af61
Pull-Request: #179999
[ghstack-poisoned]
huydhn added a commit that referenced this pull request Apr 10, 2026
The `check_public_api_test_fails` function in test.sh uses
`echo "${test_output}" | grep -q` to verify that the canary module was
detected. Under `-o pipefail` (set by the GHA shell), this is a race
condition: `grep -q` exits immediately on first match, but `echo` may
still be writing the large test output (~hundreds of lines of import
tracebacks), receiving SIGPIPE (exit 141). With `pipefail`, the pipeline
returns 141 instead of grep's 0, so the script incorrectly concludes the
canary wasn't found.

Replace the pipe with a here-string (`grep -q ... <<< "$var"`), which
passes content via a temporary file rather than a pipe, eliminating the
SIGPIPE race entirely.

Fixes flaky failures like:
https://github.com/pytorch/pytorch/actions/runs/24216395495/job/70700891103

Authored with Claude.


ghstack-source-id: f5e7eef
Pull-Request: #179999
[ghstack-poisoned]
huydhn added a commit that referenced this pull request Apr 11, 2026
The `check_public_api_test_fails` function in test.sh uses
`echo "${test_output}" | grep -q` to verify that the canary module was
detected. Under `-o pipefail` (set by the GHA shell), this is a race
condition: `grep -q` exits immediately on first match, but `echo` may
still be writing the large test output (~hundreds of lines of import
tracebacks), receiving SIGPIPE (exit 141). With `pipefail`, the pipeline
returns 141 instead of grep's 0, so the script incorrectly concludes the
canary wasn't found.

Replace the pipe with a here-string (`grep -q ... <<< "$var"`), which
passes content via a temporary file rather than a pipe, eliminating the
SIGPIPE race entirely.

Fixes flaky failures like:
https://github.com/pytorch/pytorch/actions/runs/24216395495/job/70700891103

Authored with Claude.


ghstack-source-id: 9b1b64b
Pull-Request: #179999
[ghstack-poisoned]
huydhn added a commit that referenced this pull request Apr 11, 2026
The `check_public_api_test_fails` function in test.sh uses
`echo "${test_output}" | grep -q` to verify that the canary module was
detected. Under `-o pipefail` (set by the GHA shell), this is a race
condition: `grep -q` exits immediately on first match, but `echo` may
still be writing the large test output (~hundreds of lines of import
tracebacks), receiving SIGPIPE (exit 141). With `pipefail`, the pipeline
returns 141 instead of grep's 0, so the script incorrectly concludes the
canary wasn't found.

Replace the pipe with a here-string (`grep -q ... <<< "$var"`), which
passes content via a temporary file rather than a pipe, eliminating the
SIGPIPE race entirely.

Fixes flaky failures like:
https://github.com/pytorch/pytorch/actions/runs/24216395495/job/70700891103

Authored with Claude.


ghstack-source-id: 549ff01
Pull-Request: #179999
[ghstack-poisoned]
huydhn added a commit that referenced this pull request Apr 11, 2026
The `check_public_api_test_fails` function in test.sh uses
`echo "${test_output}" | grep -q` to verify that the canary module was
detected. Under `-o pipefail` (set by the GHA shell), this is a race
condition: `grep -q` exits immediately on first match, but `echo` may
still be writing the large test output (~hundreds of lines of import
tracebacks), receiving SIGPIPE (exit 141). With `pipefail`, the pipeline
returns 141 instead of grep's 0, so the script incorrectly concludes the
canary wasn't found.

Replace the pipe with a here-string (`grep -q ... <<< "$var"`), which
passes content via a temporary file rather than a pipe, eliminating the
SIGPIPE race entirely.

Fixes flaky failures like:
https://github.com/pytorch/pytorch/actions/runs/24216395495/job/70700891103

Authored with Claude.


ghstack-source-id: b2726c3
Pull-Request: #179999
[ghstack-poisoned]
huydhn added a commit that referenced this pull request Apr 11, 2026
The `check_public_api_test_fails` function in test.sh uses
`echo "${test_output}" | grep -q` to verify that the canary module was
detected. Under `-o pipefail` (set by the GHA shell), this is a race
condition: `grep -q` exits immediately on first match, but `echo` may
still be writing the large test output (~hundreds of lines of import
tracebacks), receiving SIGPIPE (exit 141). With `pipefail`, the pipeline
returns 141 instead of grep's 0, so the script incorrectly concludes the
canary wasn't found.

Replace the pipe with a here-string (`grep -q ... <<< "$var"`), which
passes content via a temporary file rather than a pipe, eliminating the
SIGPIPE race entirely.

Fixes flaky failures like:
https://github.com/pytorch/pytorch/actions/runs/24216395495/job/70700891103

Authored with Claude.


ghstack-source-id: c28b641
Pull-Request: #179999
[ghstack-poisoned]
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

@huydhn your PR has been reverted as part of the stack under #179994.

@pytorchmergebot pytorchmergebot added Reverted ci-no-td Do not run TD on this PR labels Apr 14, 2026
[ghstack-poisoned]
huydhn added a commit that referenced this pull request Apr 14, 2026
The `check_public_api_test_fails` function in test.sh uses
`echo "${test_output}" | grep -q` to verify that the canary module was
detected. Under `-o pipefail` (set by the GHA shell), this is a race
condition: `grep -q` exits immediately on first match, but `echo` may
still be writing the large test output (~hundreds of lines of import
tracebacks), receiving SIGPIPE (exit 141). With `pipefail`, the pipeline
returns 141 instead of grep's 0, so the script incorrectly concludes the
canary wasn't found.

Replace the pipe with a here-string (`grep -q ... <<< "$var"`), which
passes content via a temporary file rather than a pipe, eliminating the
SIGPIPE race entirely.

Fixes flaky failures like:
https://github.com/pytorch/pytorch/actions/runs/24216395495/job/70700891103

Authored with Claude.


ghstack-source-id: 38b7089
Pull-Request: #179999
BoyuanFeng pushed a commit that referenced this pull request Apr 15, 2026
The `check_public_api_test_fails` function in test.sh uses
`echo "${test_output}" | grep -q` to verify that the canary module was
detected. Under `-o pipefail` (set by the GHA shell), this is a race
condition: `grep -q` exits immediately on first match, but `echo` may
still be writing the large test output (~hundreds of lines of import
tracebacks), receiving SIGPIPE (exit 141). With `pipefail`, the pipeline
returns 141 instead of grep's 0, so the script incorrectly concludes the
canary wasn't found.

Replace the pipe with a here-string (`grep -q ... <<< "$var"`), which
passes content via a temporary file rather than a pipe, eliminating the
SIGPIPE race entirely.

Fixes flaky failures like:
https://github.com/pytorch/pytorch/actions/runs/24216395495/job/70700891103

### Testing

https://github.com/pytorch/pytorch/actions/runs/24262053518/job/70850088090?pr=179999

Authored with Claude.
Pull Request resolved: #179999
Approved by: https://github.com/malfet
ghstack dependencies: #179994
BoyuanFeng pushed a commit that referenced this pull request Apr 15, 2026
@huydhn

huydhn commented Apr 15, 2026

Copy link
Copy Markdown
Contributor Author

@pytorchbot drci

1 similar comment
@huydhn

huydhn commented Apr 15, 2026

Copy link
Copy Markdown
Contributor Author

@pytorchbot drci

@huydhn

huydhn commented Apr 15, 2026

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge -f 'backwards_compat tests are passing'

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

pytorchmergebot added a commit to scotts/pytorch that referenced this pull request Apr 15, 2026
@github-actions
github-actions Bot deleted the gh/huydhn/28/head branch May 16, 2026 02:26
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
The `check_public_api_test_fails` function in test.sh uses
`echo "${test_output}" | grep -q` to verify that the canary module was
detected. Under `-o pipefail` (set by the GHA shell), this is a race
condition: `grep -q` exits immediately on first match, but `echo` may
still be writing the large test output (~hundreds of lines of import
tracebacks), receiving SIGPIPE (exit 141). With `pipefail`, the pipeline
returns 141 instead of grep's 0, so the script incorrectly concludes the
canary wasn't found.

Replace the pipe with a here-string (`grep -q ... <<< "$var"`), which
passes content via a temporary file rather than a pipe, eliminating the
SIGPIPE race entirely.

Fixes flaky failures like:
https://github.com/pytorch/pytorch/actions/runs/24216395495/job/70700891103

### Testing

https://github.com/pytorch/pytorch/actions/runs/24262053518/job/70850088090?pr=179999

Authored with Claude.
Pull Request resolved: pytorch#179999
Approved by: https://github.com/malfet
ghstack dependencies: pytorch#179994
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
The `check_public_api_test_fails` function in test.sh uses
`echo "${test_output}" | grep -q` to verify that the canary module was
detected. Under `-o pipefail` (set by the GHA shell), this is a race
condition: `grep -q` exits immediately on first match, but `echo` may
still be writing the large test output (~hundreds of lines of import
tracebacks), receiving SIGPIPE (exit 141). With `pipefail`, the pipeline
returns 141 instead of grep's 0, so the script incorrectly concludes the
canary wasn't found.

Replace the pipe with a here-string (`grep -q ... <<< "$var"`), which
passes content via a temporary file rather than a pipe, eliminating the
SIGPIPE race entirely.

Fixes flaky failures like:
https://github.com/pytorch/pytorch/actions/runs/24216395495/job/70700891103

### Testing

https://github.com/pytorch/pytorch/actions/runs/24262053518/job/70850088090?pr=179999

Authored with Claude.
Pull Request resolved: pytorch#179999
Approved by: https://github.com/malfet
ghstack dependencies: pytorch#179994
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
The `check_public_api_test_fails` function in test.sh uses
`echo "${test_output}" | grep -q` to verify that the canary module was
detected. Under `-o pipefail` (set by the GHA shell), this is a race
condition: `grep -q` exits immediately on first match, but `echo` may
still be writing the large test output (~hundreds of lines of import
tracebacks), receiving SIGPIPE (exit 141). With `pipefail`, the pipeline
returns 141 instead of grep's 0, so the script incorrectly concludes the
canary wasn't found.

Replace the pipe with a here-string (`grep -q ... <<< "$var"`), which
passes content via a temporary file rather than a pipe, eliminating the
SIGPIPE race entirely.

Fixes flaky failures like:
https://github.com/pytorch/pytorch/actions/runs/24216395495/job/70700891103

### Testing

https://github.com/pytorch/pytorch/actions/runs/24262053518/job/70850088090?pr=179999

Authored with Claude.
Pull Request resolved: pytorch#179999
Approved by: https://github.com/malfet
ghstack dependencies: pytorch#179994
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
The `check_public_api_test_fails` function in test.sh uses
`echo "${test_output}" | grep -q` to verify that the canary module was
detected. Under `-o pipefail` (set by the GHA shell), this is a race
condition: `grep -q` exits immediately on first match, but `echo` may
still be writing the large test output (~hundreds of lines of import
tracebacks), receiving SIGPIPE (exit 141). With `pipefail`, the pipeline
returns 141 instead of grep's 0, so the script incorrectly concludes the
canary wasn't found.

Replace the pipe with a here-string (`grep -q ... <<< "$var"`), which
passes content via a temporary file rather than a pipe, eliminating the
SIGPIPE race entirely.

Fixes flaky failures like:
https://github.com/pytorch/pytorch/actions/runs/24216395495/job/70700891103

### Testing

https://github.com/pytorch/pytorch/actions/runs/24262053518/job/70850088090?pr=179999

Authored with Claude.
Pull Request resolved: pytorch#179999
Approved by: https://github.com/malfet
ghstack dependencies: pytorch#179994
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-td Do not run TD on this PR Merged Reverted topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants