We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 74b6c09 commit de53635Copy full SHA for de53635
tests/utils.rs
@@ -1,5 +1,7 @@
1
use std::io::{BufRead, BufReader};
2
use std::process::{Child, Command, Stdio};
3
+use std::thread;
4
+use std::time::Duration;
5
6
pub struct ServerGuard {
7
child: Child,
@@ -23,7 +25,7 @@ impl ServerGuard {
23
25
24
26
// Get stdout handle and create a reader
27
let stderr = child.stderr.take().expect("Failed to capture stdout");
- let mut reader = BufReader::new(stderr);
28
+ let reader = BufReader::new(stderr);
29
30
// Read lines until we see the listening message
31
for line in reader.lines() {
@@ -37,6 +39,8 @@ impl ServerGuard {
37
39
// Set stdout to inherit for remaining output
38
40
child.stdout = None;
41
42
+ thread::sleep(Duration::from_millis(500));
43
+
44
ServerGuard { child, port }
45
}
46
0 commit comments