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

Sporadic test failure on Subscriber #2

Open
tesaguri opened this issue Nov 28, 2020 · 1 comment
Open

Sporadic test failure on Subscriber #2

tesaguri opened this issue Nov 28, 2020 · 1 comment

Comments

@tesaguri
Copy link
Owner

Offending code in the test:

// Subscription renewal.
// tokio::task::yield_now().await;
tokio::time::advance(MARGIN).await;
let (tx, rx) = oneshot::channel();
let mut tx = Some(tx);
// FIXME: This line occasionally hangs. If you uncomment `yield_now` above,
// the hang occurs deterministically.
let sock = listener.next().timeout().await.unwrap().unwrap();

The tokio::time::advance should trigger a subscription renewal and the hub listener should receive a subscription request, but in fact, the listener occasionally hangs.

If you uncomment the yield_now, the Scheduler's get_next_tick callback seems to fire before calling tokio::time::advance(), which is unexpected since the refresh_time has not passed then.

tokio-rs/tokio#2090 may be relevant, I guess.

@tesaguri
Copy link
Owner Author

Workaround for this was made by replacing the usage of pause()/advance() with actual sleep()s (2b2fb9c), but this is definitely not great as it significantly delays the tests.

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

No branches or pull requests

1 participant