-
Notifications
You must be signed in to change notification settings - Fork 507
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
Make test 'iter_panic_fuse' deterministic #674
Conversation
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'
6d7bfe6
to
9532eb5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. It feels sad to force single-threaded, but I think we're still performing a effective test anyway.
Fixes #667
That issue also mentions check_partial_cmp_short_circuit
-- care to address this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sgtm once @cuviper is happy
Thanks!
I added a commit for this myself. bors r+ |
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]>
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.