Skip to content

Commit

Permalink
Speedup multi exit test convergence
Browse files Browse the repository at this point in the history
This should handle both situatiosn where switching is faster and when
it is slower, hopefully making the tests more reliable and faster.
  • Loading branch information
jkilpatr committed Aug 30, 2024
1 parent eb05e9c commit 1a328b3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion integration_tests/src/mutli_exit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,16 @@ pub async fn run_multi_exit_test() {
current_exit.get_name()
);

thread::sleep(Duration::from_secs(10));
const MIGRATION_ATTEMPT_TIMEOUT: Duration = Duration::from_secs(10);
let start = std::time::Instant::now();

while start.elapsed() < MIGRATION_ATTEMPT_TIMEOUT {
let new_exit = get_current_exit(namespaces.names[0].clone(), namespaces.clone());
if new_exit != current_exit {
break;
}
thread::sleep(Duration::from_secs(1));
}

// Check that we migrated
let new_exit = get_current_exit(namespaces.names[0].clone(), namespaces.clone());
Expand Down

0 comments on commit 1a328b3

Please sign in to comment.