Skip to content
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

channel: ready::fairness2 test is racy #477

Closed
jonhoo opened this issue Feb 22, 2020 · 3 comments · Fixed by #495
Closed

channel: ready::fairness2 test is racy #477

jonhoo opened this issue Feb 22, 2020 · 3 comments · Fixed by #495

Comments

@jonhoo
Copy link
Contributor

jonhoo commented Feb 22, 2020

The test occasionally fails in CI and locally.

Reproduce by running:

$ for (( i=1 ;; i+=1 )); do echo "*** test $i ***"; cargo test --test ready fairness || break; done

To quote @cuviper:

It seems to fail even more frequently with --release, so maybe the test just needs more allowance?

@ghost
Copy link

ghost commented May 3, 2020

Hmm yeah that definitely looks like a fluke - statistically speaking, the test is bound to fail :) (but we hope so rarely it never actually fails). I think bumping the threshold should do the trick.

@jonhoo
Copy link
Contributor Author

jonhoo commented May 3, 2020

I tried changing the assertion to

assert!(hits.iter().all(|x| x.get() > 0));

And unfortunately even that sometimes fails. I guess we'd have to increase the count?

jonhoo added a commit to jonhoo/crossbeam that referenced this issue May 3, 2020
@jonhoo
Copy link
Contributor Author

jonhoo commented May 3, 2020

I opened #495 with the updated assertion and an increased COUNT, and that seems to not be racy for me at least.

@ghost ghost closed this as completed in #495 May 19, 2020
jeehoonkang pushed a commit to tomtomjhj/crossbeam that referenced this issue May 19, 2020
exrook pushed a commit to exrook/crossbeam that referenced this issue Oct 7, 2020
In practice servers will occasionally become unreachable and trying
to allocate to them will fail. Rather than leaking capacity in this
case we remove the job on allocation failure. Fixes crossbeam-rs#477
exrook pushed a commit to exrook/crossbeam that referenced this issue Oct 7, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant