From b610c16be24d269b66a0f61ee24adf87e0e001ba Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Thu, 13 Oct 2022 13:48:01 -0700 Subject: [PATCH] Fix race condition in commit test --- src/subcommand/server.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/subcommand/server.rs b/src/subcommand/server.rs index dd16222ab3..0e3a3974d7 100644 --- a/src/subcommand/server.rs +++ b/src/subcommand/server.rs @@ -631,6 +631,10 @@ mod tests { thread::spawn(|| server.run(options, index, ord_server_handle).unwrap()); } + while index.statistic(crate::index::Statistic::Commits).unwrap() == 0 { + thread::sleep(Duration::from_millis(25)); + } + for i in 0.. { match reqwest::blocking::get(&format!("http://127.0.0.1:{port}/status")) { Ok(_) => break, @@ -1399,7 +1403,7 @@ mod tests { } #[test] - fn commit_are_tracked() { + fn commits_are_tracked() { let server = TestServer::new(); assert_eq!(