-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intermittent test failures on master #667
Comments
Seeing this issue from another, unrelated Windows machine. rustc 1.35.0 (3c235d560 2019-05-20)
|
I'm not concerned about the "panicked at 'boom'" output in general. These tests are intentionally panicking, and Rust testing is imperfect about capturing output -- rust-lang/rust#42474. But in the places where the tests actually fail, we do need to figure that out. It's interesting that this seems to be associated with Windows, as I'm not sure what would be OS specific here. It's possible that these are just getting unlucky with iterator splits. Both of those tests are making assertions about short-circuiting, that we won't visit every item in the iterator. If it happens to split such that the triggering item is actually the last seen, then the short circuit behavior won't really have the desired effect. So, I think these are just flaky tests, not a real problem. Fixing them may still be tricky. |
Now that I think about it, this issue are two in one:
No idea about the bug. About AppVeyor, maybe only runs the test on one core and doesn't provoke it? If so, it might be worthwhile to reconfigure the test runner to catch similar bugs in the future. |
A single-threaded "pool" would essentially run those tests in sequential order, which should be completely deterministic in succeeding. Maybe that is indeed what's helping AppVeyor, but I thought they did have multiple cores. (I'm already tempted to move all our platforms to a single CI though.) |
Does the build / test output print the number of cores that were detected? If so the CI logs might tell that already somewhere. |
I don't see that in the logs: https://ci.appveyor.com/project/cuviper/rayon But it looks like there should be at least 2 cores: https://www.appveyor.com/docs/build-environment/#build-vm-configurations |
I'm able to consistently reproduce this locally on |
The problem appears to be that these assertions are fundamentally racy. They assume that a panic fairly early on will cause |
Fixes rayon-rs#667 'panic_fuse' will only stop other threads 'as soon as possible' - if the other threads are fast enough, they might end up processing the entire rest of the iterator. This commit changes the test 'iter_panic_fuse' to properly take this into account, by creating a custom threadpool with only 1 thread. This makes the test deterministic - with only one thread, the panic is guaranmteed to be observed when the next item is processed, causing the desired early exit.
Fixes rayon-rs#667 'panic_fuse' will only stop other threads 'as soon as possible' - if the other threads are fast enough, they might end up processing the entire rest of the iterator. This commit changes the test 'iter_panic_fuse' to properly take this into account, by creating a custom threadpool with only 1 thread. This makes the test deterministic - with only one thread, the panic is guaranmteed to be observed when the next item is processed, causing the desired early exit. I've also added the 'more-asserts' crate as a dev dependency, so that we can print out a more informative error message in 'iter_panic_fuse'
674: Make test 'iter_panic_fuse' deterministic r=cuviper a=Aaron1011 Fixes #667 'panic_fuse' will only stop other threads 'as soon as possible' - if the other threads are fast enough, they might end up processing the entire rest of the iterator. This commit changes the test 'iter_panic_fuse' to properly take this into account, by creating a custom threadpool with only 1 thread. This makes the test deterministic - with only one thread, the panic is guaranmteed to be observed when the next item is processed, causing the desired early exit. Co-authored-by: Aaron Hill <[email protected]> Co-authored-by: Josh Stone <[email protected]>
While working on #666 I noticed that my
cargo test
is sometimes failing, even on master. However, not always the same tests fail, and they don't fail all the time.The one I can most easily reproduce (about 20 - 30 out of 50 times I tried the last ~2h):
Then there is, which happened once so far:
Even when
cargo test
succeeds, I am still receiving something like this on the console during the run.I have a little bit the impression that once I wipe everything there is a higher chance that everything test the very first time, but I've only tried that 3-4 time so far, so that might be chance.
Things I tried:
cargo clean
cargo test --release
target/
git clone
~/.cargo
and~/.rustup
I am running
stable-x86_64-pc-windows-msvc
rustc 1.35.0 (3c235d560 2019-05-20)
Microsoft (R) Incremental Linker Version 14.21.27702.2
On my Mac the tests seem to work.
Update - And I'm seeing the same issue on an old Windows notebook of mine witha fresh Rust install.
The text was updated successfully, but these errors were encountered: