Skip to content

Commit de53635

Browse files
committed
make tests slightly more reliable
1 parent 74b6c09 commit de53635

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/utils.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
use std::io::{BufRead, BufReader};
22
use std::process::{Child, Command, Stdio};
3+
use std::thread;
4+
use std::time::Duration;
35

46
pub struct ServerGuard {
57
child: Child,
@@ -23,7 +25,7 @@ impl ServerGuard {
2325

2426
// Get stdout handle and create a reader
2527
let stderr = child.stderr.take().expect("Failed to capture stdout");
26-
let mut reader = BufReader::new(stderr);
28+
let reader = BufReader::new(stderr);
2729

2830
// Read lines until we see the listening message
2931
for line in reader.lines() {
@@ -37,6 +39,8 @@ impl ServerGuard {
3739
// Set stdout to inherit for remaining output
3840
child.stdout = None;
3941

42+
thread::sleep(Duration::from_millis(500));
43+
4044
ServerGuard { child, port }
4145
}
4246

0 commit comments

Comments
 (0)