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

outbound: replace sleeps in test with yield_now #1085

Merged
merged 1 commit into from
Jun 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions linkerd/app/outbound/src/tcp/logical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ mod tests {
resolve_tx
.add(Some((ep0_addr, Default::default())))
.unwrap();
time::sleep(time::Duration::from_secs(1)).await; // Let the balancer observe the update.
tokio::task::yield_now().await; // Let the balancer observe the update.
let (io, task) = spawn_io();
svc.clone().oneshot(io).await.unwrap();
let msg = task.await.unwrap().unwrap();
Expand All @@ -259,7 +259,7 @@ mod tests {
resolve_tx
.add(Some((ep1_addr, Default::default())))
.unwrap();
time::sleep(time::Duration::from_secs(1)).await; // Let the balancer observe the update.
tokio::task::yield_now().await; // Let the balancer observe the update.
let mut seen0 = false;
let mut seen1 = false;
for i in 1..=100 {
Expand Down Expand Up @@ -294,7 +294,7 @@ mod tests {
// When we remove the ep0, all traffic goes to ep1:

resolve_tx.remove(Some(ep0_addr)).unwrap();
time::sleep(time::Duration::from_secs(1)).await; // Let the balancer observe the update.
tokio::task::yield_now().await; // Let the balancer observe the update.
for _ in 1..=100 {
let (io, task) = spawn_io();
svc.clone().oneshot(io).await.unwrap();
Expand All @@ -306,7 +306,7 @@ mod tests {
// Empty load balancers hit fail-fast errors:

resolve_tx.remove(Some(ep1_addr)).unwrap();
time::sleep(time::Duration::from_secs(1)).await; // Let the balancer observe the update.
tokio::task::yield_now().await; // Let the balancer observe the update.
let (io, task) = spawn_io();
let err = svc
.clone()
Expand Down