-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
chore: Racy buffering tests correction #2106
Conversation
Great PR! Please pay attention to the following items before merging: Files matching
This is an automatically generated QA checklist based on modified files |
d2e04c7
to
89486a9
Compare
89486a9
to
b16d174
Compare
Signed-off-by: MOZGIII <[email protected]>
Signed-off-by: MOZGIII <[email protected]>
Signed-off-by: MOZGIII <[email protected]>
Signed-off-by: MOZGIII <[email protected]>
Signed-off-by: MOZGIII <[email protected]>
Signed-off-by: MOZGIII <[email protected]>
- remove `sink_with_buffer_size` - add `channel_size` arg to `sink` and `sink_failing_healthcheck` Rationale is it's otherwise unobvious how sink is implemented, and having a hidden constant of 10 can cause confusion. It's better to force users to put an arbitrary number there when they don't care about the channel size - cause it's clear and explicit, compared to more concise, but obtrusive notation. This also reduces the API surface. Signed-off-by: MOZGIII <[email protected]> # Conflicts: # tests/support/mod.rs
Signed-off-by: MOZGIII <[email protected]>
Signed-off-by: MOZGIII <[email protected]>
This is a proper way to avoid relying on the sink channel size Signed-off-by: MOZGIII <[email protected]>
Signed-off-by: MOZGIII <[email protected]>
Before sleep was used to cope with a race condition. We don't have that particular race anymore. We have a new one though, the same as in `test_buffering` and `test_max_size`. However, we don't care about that one in this test, because based on empiric checks, it doesn't seem to contribute any meaningful difference. The cause of this race condition is not clear so far, so it's hard to say anything certain here. Signed-off-by: MOZGIII <[email protected]>
…ring logic Signed-off-by: MOZGIII <[email protected]>
Signed-off-by: MOZGIII <[email protected]>
Signed-off-by: MOZGIII <[email protected]>
Signed-off-by: MOZGIII <[email protected]>
Signed-off-by: MOZGIII <[email protected]>
Signed-off-by: MOZGIII <[email protected]>
Signed-off-by: MOZGIII <[email protected]>
Signed-off-by: MOZGIII <[email protected]>
b16d174
to
90bbc1e
Compare
Signed-off-by: MOZGIII <[email protected]>
// Using a shared mod like this is probably not the best idea, since we have to | ||
// disable the `dead_code` lint, as we don't need all of the helpers from here | ||
// all over the place. | ||
#![allow(dead_code)] |
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.
I'm a bit confused. If we have dead code why do we not just remove it?
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.
The problem is this mod is used in tests, and each test is an individual compile unit. So, tests/buffering.rs
complains about one set of fns as dead code, and tests/topology.rs
doesn’t like the other. This is kind of a bad pattern to organize test helpers like that, but here we are.
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.
The problem is this mod is used in tests, and each test is an individual compile unit. So, tests/buffering.rs
complains about one set of fns as dead code, and tests/topology.rs
doesn’t like the other. This is kind of a bad pattern to organize test helpers like that, but here we are.
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.
@Hoverbear we'll need to refactor it at some point. I don't want to do it as part of this PR though since it's sort of a hotfix, and we better merge is asap.
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.
Agreed. :)
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.
much better 👍
Closes #2102.
This solved the issue with racy buffer checking tests.
This, in turn, should fix our nightly builds! 🎉