Reject test servers that exit after a port race
This commit is contained in:
1 parent
313ea366d6
commit
090f389589
1 file changed
+8
@@ -108,6 +108,14 @@ impl TestServer {
|
||||
for _ in 0..1800 {
|
||||
if let Ok(response) = send(self.port, "GET", "/", &[], "text/plain") {
|
||||
if response.status == 200 {
|
||||
std::thread::sleep(Duration::from_millis(100));
|
||||
if let Some(status) = self.child.try_wait().expect("poll server") {
|
||||
return Err(format!(
|
||||
"server on port {} exited with {status}:\n{}",
|
||||
self.port,
|
||||
self.log()
|
||||
));
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user