From 06d4d2880b79e4ec2e2bdac029a73b5cceaf8b4c Mon Sep 17 00:00:00 2001 From: evenyag Date: Wed, 15 May 2024 16:22:47 +0800 Subject: [PATCH] test: wait for file change in test multiple times --- src/servers/src/tls.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/servers/src/tls.rs b/src/servers/src/tls.rs index 2055081012ca..c7c33328c221 100644 --- a/src/servers/src/tls.rs +++ b/src/servers/src/tls.rs @@ -425,7 +425,12 @@ mod tests { .expect("failed to copy key to tmpdir"); // waiting for async load - std::thread::sleep(std::time::Duration::from_millis(300)); + for _ in 0..3 { + std::thread::sleep(std::time::Duration::from_millis(300)); + if server_config.get_version() > 1 { + break; + } + } assert!(server_config.get_version() > 1); assert!(server_config.get_server_config().is_some()); }