tests/tail: Fix tests to reflect changes from the refactoring #3905#3965
tests/tail: Fix tests to reflect changes from the refactoring #3905#3965sylvestre merged 1 commit intouutils:mainfrom
tests/tail: Fix tests to reflect changes from the refactoring #3905#3965Conversation
tail: Fix piped and redirected input for windows
b76af7f to
7b354a2
Compare
tail: Fix piped and redirected input for windowstail: Fix piped and redirected input and other functionality
tertsdiepraam
left a comment
There was a problem hiding this comment.
Looks like you forgot to include the changes in tail.rs? I only see test_tail.rs and random.rs.
There was a problem hiding this comment.
Instead of what? Also debug_assert is not very meaningful in tests. Tests are not included in regular binaries and should probably always fail early if something yas gone wrong, even when run with --release
There was a problem hiding this comment.
Sorry, seems my TODOs are only meant for me. This is a quick one about adding a debug_assert() in tail.rs() after the immediate exit because of -[nc]0 without -f instead of trying to provoke an error like passing a missing file to tail. A debug_assert() is more precise in my eyes.
There was a problem hiding this comment.
Why is this removed?
There was a problem hiding this comment.
Because the test is platform specific in contrast to test_nc_0_wo_follow and it doesn't more information. In my eyes the test_nc_0_wo_follow test was sufficient. However, it could be more precise with the debug_assert(). If you like to, I can readd it.
There was a problem hiding this comment.
I can't follow your reasoning.
Because the test is platform specific in contrast to test_nc_0_wo_follow
This should not be a reason to remove a test.
and it doesn't more information.
But the two tests check different things.
There was a problem hiding this comment.
There's a couple of these FIXME: comments. I'd say either give an explanation or remove the colon :)
There was a problem hiding this comment.
Sorry, my FIXME parser doesn't colorize these without the colon. Maybe I can change that somewhere in the settings. I hoped the FIXMEs are seen as annotation for the not working platforms.
There was a problem hiding this comment.
However, I'll write a short explanation for the standalone FIXMEs :)
There was a problem hiding this comment.
Is this test gonna work on all platforms eventually or can it only be fixed for some platforms?
There was a problem hiding this comment.
Good question...
There was a problem hiding this comment.
We should probably keep the cfg then, ut was probably added for a reason.
There was a problem hiding this comment.
Feels like we should definitely keep these? CI can't cover every possible arch and OS we want to run the tests on
There was a problem hiding this comment.
How does it do this?
There was a problem hiding this comment.
It does so because this is the exact code from the test in which I used the random generator and the test timed out. But there's more code in the test, so to exclude the possibility that it has something to do with the random string generator, I added these lines from the test here and test them separately.
There was a problem hiding this comment.
Hmm, ok, I'm not 100% if this is useful, but I think it's a vit better to at least add that explanation to the code here
I didn't change anything in |
|
@tertsdiepraam A little addition to my last comment. I'm not sure if my explanation in the header of this pr was a little bit short. This pr doesn't change any production code. I've already done this in the refactoring pr. I'm kind of summarizing in this pr, what was achieved in the refactoring pr #3905. |
|
I see. That makes sense, but indeed wasn't totally clear to me from the title and description. |
tail: Fix piped and redirected input and other functionalitytests/tail: Fix tests to reflect changes from the refactoring #3905
|
@tertsdiepraam I updated the title and description |
2e86269 to
c6a2d5d
Compare
tertsdiepraam
left a comment
There was a problem hiding this comment.
I generally like this change. Enabling more tests is always good. I have two more small comments and please put the removed test back from the last review.
There was a problem hiding this comment.
Please remove this TODO
c6a2d5d to
8f80def
Compare
Thanks :) and thanks for the review.
Generally, I like more tests, too. But here, I also wanted to cement what we gained so far.
Concerning the TODO and tests, please let me propose an alternative solution, which improves these tests a little bit. Originally, I didn't want to alter production files in this pr, so I kept this TODO. However, I added an additional commit, so you can see, what I meant with the TODO. |
Please do not remove the two |
|
@tertsdiepraam Did you already have a look at the last commit? |
|
Sorry, I don't like the |
|
@tertsdiepraam No problem. |
8f80def to
41226ba
Compare
|
@tertsdiepraam I took care of all your comments. The macos timeout looks like a ci problem. All other tests on macos have been running successfully... |
41226ba to
6485f58
Compare
jhscheer
left a comment
There was a problem hiding this comment.
Looks good to me.
Please consider my suggestions.
Thanks for all the extensive testing on the various platforms.
There was a problem hiding this comment.
This test is problematic. It has been observed to sometimes fail on MinRustV and now macOS.
#3929
Until this is fixed I would not relax the cfg.
There was a problem hiding this comment.
Are you aware that this comes across as quite rude? Why is this a won't fix? @jhscheer brings up a valid problem with your PR, so that needs to be fixed before we can merge this. I'm unresolving this conversation until it is actually resolved.
There was a problem hiding this comment.
It's a won't fix because this is actually valuable information about the intermittenly failing tests. Additionally, these intermittently failing tests are not part of this pr nor the refactoring on which this pr is based on. You may wish to disable the test until it is fixed, but I would suggest another pr for this.
There was a problem hiding this comment.
But this PR enables the test on mac, which is not correct. So this PR should not introduce that change in the first place.
There was a problem hiding this comment.
The retry9 test is failing intermittently, but not because of the refactoring pr. It also does on macos but now you can notice this fact and maybe it helps figuring out the problem. The test usually passes and if not then because of #3929.
There was a problem hiding this comment.
We try to keep intermittent failure to a minimum, because it affects everyone's CI for PRs. We can't accept PRs that knowingly introduce more intermittent failures.
but not because of the refactoring pr.
The refactoring PR has nothing to do with this. There is a test that fails (intermittently) and this PR enables it, which is a problem and that is why this PR has to just not do that.
It also does on macos but now you can notice this fact and maybe it helps figuring out the problem.
We now indeed know this and that is helpful, but that's not a valid reason that we should ignore the problem here. We're not asking you to fix anything, just to revert the change that you made for this specific test.
There was a problem hiding this comment.
Not meant badly, I'm not sure this is going into the right direction, but if dsabling this test on macos is all you want, it's done.
There was a problem hiding this comment.
In case a test runs locally but not in the CI, I would use is_ci(), instead of disabling the test completely.
e.g.
if cfg!(windows) && is_ci() {
println!("TEST SKIPPED (<reason>)");
return;
}There was a problem hiding this comment.
Please explain why "Won't fix"
There was a problem hiding this comment.
I won't change it, because it's correct the way it is. It clearly indicates the implementation has a problem on windows. The comment just explains what I've found out and is a help for others. Sure it's failing in the ci and passing on my pc and my virtualbox but that doesn't mean there's something wrong with the implementation for windows, so it is switched off entirely. Windows pipes are different from unix pipes and fixing this in this pr is out of the scope of this pr. Additionally, if someone's running the test suite on windows but working on uutils in a different place he may probably run in this timeout.
There was a problem hiding this comment.
See comment about is_ci() above.
8a4416a to
0897bbc
Compare
0897bbc to
1725151
Compare
This is a follow up pr to #3905 (refactoring tail), in which the tests for tail are updated to reflect the current state of tail's implementation.
I removed all cfg attributes from the tests which limited the tests by vendor, os (ci 8594), then added cfg attributes again for the tests failing in the ci for a specific target os (ci 8604, ci 8605, ci 8606, ci 8607). This is a quick overview over the outcome and the main differences to before the refactoring:
Summary and curated diff from this branch to main
For completeness:
I needed to keep 2 piped input tests for windows switched off which are not working in the ci because the tests timed out. I couldn't reproduce locally why they are hanging and they ran successfully in a Windows 10 Virtualbox image.
Fixes #3881