Skip to content

Conversation

@ChrisDryden
Copy link
Collaborator

@ChrisDryden ChrisDryden commented Jan 15, 2026

There was quite a bunch of different features missing in timeout, to start off, now that we have a mechanism to read the SIGPIPE handlers before they are overwritten by the rust runtime, it means that we can not propagate this signal down to the child processes if the signal is set to ignore.

This also includes all of the latest changes since 9.9 where the specific signal sent to timeout will be propagated instead of just defaulting to a TERM signal.

@ChrisDryden ChrisDryden force-pushed the timeout-fixes-squashed branch from 93ea128 to 228824e Compare January 15, 2026 02:10
@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/shuf/shuf-reservoir (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/sort/sort-stale-thread-mem (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/timeout/timeout-group is now passing!

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/timeout/timeout-group is now passing!

@ChrisDryden
Copy link
Collaborator Author

ChrisDryden commented Jan 15, 2026

This might seem like a fairly large PR, but its actually just added ontop of this PR: #10166 and this PR: #10194, when those are in this would be much smaller

@ChrisDryden
Copy link
Collaborator Author

Another note is that we have a bunch of over-rides in the build-gnu script that override the yes and timeout command that we can remove once this is removed.

@Ecordonnier Ecordonnier self-assigned this Jan 15, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 15, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing ChrisDryden:timeout-fixes-squashed (6d8901c) with main (2839f78)

Summary

✅ 142 untouched benchmarks
⏩ 180 skipped benchmarks1

Footnotes

  1. 180 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@ChrisDryden
Copy link
Collaborator Author

@Ecordonnier Thanks for the feedback! This PR is a bit too complicated, I was thinking that the best approach here would be to add that pipe signal logic in a smaller PR to every utility. That would resolve 5+ pr's in the queue, then rebasing this one after addressing your feedback and then it would be better to understand

@Ecordonnier
Copy link
Collaborator

@Ecordonnier Thanks for the feedback! This PR is a bit too complicated, I was thinking that the best approach here would be to add that pipe signal logic in a smaller PR to every utility. That would resolve 5+ pr's in the queue, then rebasing this one after addressing your feedback and then it would be better to understand

you can do it that way if it makes sense short-term, but then you will have the same code duplicated 100 times (one time for each utility), which is not great for long-term maintenance.

@ChrisDryden
Copy link
Collaborator Author

Whoops, what I meant to say is to add it to every utility by adding it once in the bin macro to not have to have the code duplicated.

@ChrisDryden
Copy link
Collaborator Author

I'm rebasing it now after the changes to add the pipeline signal handlers to all of the utilities, should be a much smaller diff now

@ChrisDryden ChrisDryden force-pushed the timeout-fixes-squashed branch 2 times, most recently from fa027b0 to 293ded3 Compare January 21, 2026 20:56
@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/timeout/timeout-group is now passing!

@ChrisDryden
Copy link
Collaborator Author

I think the flakiness with the tee test should be resolved with this PR now. The latest change to make the yes utility have the PIPE signal handler, caused the test to fail because of this line:

        Err(err) if err.kind() == io::ErrorKind::BrokenPipe => Ok(()),

Now we can remove that line, and it makes the tee test pass and I believe now with the timeout changes, it removes the source of the flakness

@ChrisDryden ChrisDryden force-pushed the timeout-fixes-squashed branch from 293ded3 to 4421852 Compare January 21, 2026 21:16
@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/timeout/timeout-group is now passing!

@Ecordonnier
Copy link
Collaborator

Ecordonnier commented Jan 21, 2026

Do you still want #10166 to be merged? It overlaps with this PR.

@ChrisDryden
Copy link
Collaborator Author

This one covers everything, I can close that one

match exec(&buffer) {
Ok(()) => Ok(()),
// On Windows, silently handle broken pipe since there's no SIGPIPE
#[cfg(windows)]
Copy link
Collaborator

@Ecordonnier Ecordonnier Jan 22, 2026

Choose a reason for hiding this comment

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

let's move this to another PR, as it's unrelated to the rest. and please also remove this from the PR description "I also had to enable to pipe signal handlers to the yes utility ".

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The timeout gnu tests validate that when timeout yes is run with sigpipe ignored that it exits with broken pipe, I kept it because that line needs to be removed for unix to pass the gnu integ tests but it's required for windows to pass the rust integ tests we've made for it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added this in another PR here: #10429

Copy link
Collaborator

Choose a reason for hiding this comment

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

Which rust integ test do you mean?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Answering my own question: test_yes.rs calls check_termination(), this calls "run_stdout_starts_with" in util.rs, and this calls "child.close_stdout()" and triggers a BrokenPipe error on windows.

Hence several tests are triggering BrokenPipe error on windows: test_yes::test_args, test_yes::test_long_input,
test_yes::test_long_odd_output, test_yes::test_long_output, test_yes::test_simple

@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/timeout/timeout-group is now passing!

@ChrisDryden
Copy link
Collaborator Author

Removed the yes.rs change since it will be handled in the other PR, the timeout-group passes but the timeout gnu test fails since it relies on that yes change. Its split into the other PR

@Ecordonnier Ecordonnier changed the title timeout: adding all signal handlers, passing on signals to child, adding ignored signal handling timeout: add all signal handlers, pass on signals to child, add ignored signal handling Jan 26, 2026
@Ecordonnier
Copy link
Collaborator

@ChrisDryden I had restarted the one job which had failed 1 minute ago, but the merge of main cancelled the job and restarted all CI jobs ;-)

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@ChrisDryden
Copy link
Collaborator Author

So timeout-group passed in the GNU test but isn't showing in the comments?

@Ecordonnier
Copy link
Collaborator

Ecordonnier commented Jan 26, 2026

So timeout-group passed in the GNU test but isn't showing in the comments?

At least in this PR the logs of the job "Run GNU tests (native)" clearly says "PASS: tests/timeout/timeout-group.sh" in the step "Run GNU Tests".
In main (e.g. https://github.com/uutils/coreutils/actions/runs/21367773234/job/61504073540 ) the log says "timeout-group.sh: skipped test: timeout returned 142. SIGALRM not handled?"

But you are right something seems buggy in the comparison script. The step "Aggregate GNU test results" -> "compare test failures vs reference" says this in your PR:

Total tests in current run: 646
Total tests in reference: 645
New regressions: 0
Intermittent regressions: 0
Fixed tests: 0
Intermittent fixes: 2
Newly skipped tests: 0
Newly passing tests (previously skipped): 0
Newly failing tests (previously skipped): 0
Intermittent newly failing: 0
Notice: No new test failures detected
...

So somehow this is detected as a new test, and not as a test which was previously skipped.

@Ecordonnier Ecordonnier merged commit 67046f5 into uutils:main Jan 26, 2026
130 of 131 checks passed
@Ecordonnier
Copy link
Collaborator

So timeout-group passed in the GNU test but isn't showing in the comments?

This is also what coreutils-tracking sees btw ( https://github.com/uutils/coreutils-tracking/blob/accf571e14c51cdcbd7f1a57521498506d061ed6/gnu-result.json#L20822C1-L20839C4 ):

  "Mon, 26 Jan 2026 17:52:50 +0000": {
    "sha": "6124866934900219a4fba24c2ff3e3dead0c654c",
    "total": "646",
    "pass": "615",
    "skip": "8",
    "fail": "22",
    "xpass": "0",
    "error": "1"
  },
  "Tue, 27 Jan 2026 01:24:25 +0000": {
    "sha": "1c09c368db1e50d77c199a6583210e1038ba8557",
    "total": "646",
    "pass": "619",
    "skip": "7",
    "fail": "19",
    "xpass": "0",
    "error": "1"
  }

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants