tests: Harden two tests, prevent 4 flaky tests (cat, numfmt, sort, split, tee)#6000
Merged
sylvestre merged 5 commits intouutils:mainfrom Feb 28, 2024
Merged
Conversation
Now that clap#2624 has been resolved, we can and should test both variants.
See also 9995c63. There is a race condition between the writing thread and the command. It is easily possible that on the developer's machine, the writing thread is always faster, filling the kernel's buffer of the stdin pipe, thus succeeding the write. It is also easily possible that on the busy CI machines, the child command runs first for whatever reason, and exits early, thus killing the pipe, which causes the later write to fail. This results in a flaky test. Let's prevent flaky tests.
Collaborator
Author
|
Oh look! Other tests which have exactly the same setup (writing to stdin of a process that is failing due to cmdline args) cause real problems. Let's merge this PR and avoid these problems with cat, numfmt, sort, split, and tee! :) |
Collaborator
Author
|
Oh look! Yet another test has exactly the same setup (writing to stdin of a process that is exiting before reading anything) and causes real problems. Let's merge this PR and avoid these problems with cat, numfmt, sort, split, and tee! :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR improves the tests:
test_tee_no_more_writeable_1ignored memory problems, the newtest_check_unique_combinedexercises an input that wasn't possible before clap#2624)My goal was to find any flaky tests like 9995c63: When we write a large buffer to the stdin of a process that will fail at some point, then a race happens:
Arguably, these tests are unlikely to be the cause of any flakiness, but let's fix them anyway: Either it improves the situation, or makes no difference.