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

test(subscriber): prefer sleep over yield_now in tests #475

Merged
merged 3 commits into from
Oct 25, 2023

Conversation

hds
Copy link
Collaborator

@hds hds commented Oct 11, 2023

A flakiness problem has been discovered with the console-subscriber
integration tests introduced in #452. Issue #473 is tracking the issue.

It has been observed that we only "miss" the wake operation event when
it comes from yield_now(), but not when it comes from a task that
yielded due to sleep, even when the duration is zero. it is likely
that this is due to nature of the underlying race condition.

This change removes all the calls to yield_now() from the framework
tests, except those where we wish to actually test self wakes.

A flakiness problem has been discovered with the `console-subscriber`
integration tests introduced in #452. Issue #473 is tracking the issue.

It has been observed that we only "miss" the wake operation event when
it comes from `yield_now()`, but not when it comes from a task that
yielded due to `sleep`, even when the duration is zero. it is likely
that this is due to nature of the underlying race condition.

This change removes all the calls to `yield_now()` from the `framework`
tests, except those where we wish to actually test self wakes.
@hds hds requested a review from a team as a code owner October 11, 2023 10:56
Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall, this looks good to me!

i think it might be good if there were comments explaining the use of zero-duration sleeps rather than yield_nows, so that nobody comes along later and thinks "these seem like they could be replaced with yield_now", without the original context for why we use sleep here.

if you don't mind adding comments, let's get this merged!

Moved all the sleeps out into a separate function and use it to describe
why we're using sleep instead of yield_now when there's no difference.
@hds
Copy link
Collaborator Author

hds commented Oct 25, 2023

Comments added!

@hds hds merged commit 124c778 into main Oct 25, 2023
11 checks passed
@hds hds deleted the hds/console-test-prefer-sleep branch October 25, 2023 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants