Skip to content

Commit

Permalink
Merge pull request #375 from hsiangkao/reconnect-test
Browse files Browse the repository at this point in the history
test remote::server::tests::test_reconnect: Give 10 secs more to try
  • Loading branch information
imeoer authored Apr 7, 2022
2 parents a41b55d + 3f280d4 commit 47ae949
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion storage/src/remote/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ impl AsRawFd for Server {
#[cfg(test)]
mod tests {
use super::*;
use std::time::Duration;
use std::time::{Duration, Instant};
use vmm_sys_util::tempdir::TempDir;

#[test]
Expand Down Expand Up @@ -398,6 +398,14 @@ mod tests {

server.stop();
std::thread::sleep(Duration::from_secs(4));
let starttime = Instant::now();
/* give 10secs more to try */
while starttime.elapsed() < Duration::from_secs(10) {
if server.state.active_workers.load(Ordering::Relaxed) == 0 {
break;
}
std::thread::sleep(Duration::from_secs(1));
}
assert_eq!(server.state.active_workers.load(Ordering::Relaxed), 0);
drop(server);

Expand Down

0 comments on commit 47ae949

Please sign in to comment.