Skip to content

Sporadic test failure on Subscriber #2

Open
@tesaguri

Description

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.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions