cultmesh-rs tests: say what the interop peer said when it dies early
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
d0a28918ce
commit
278238cf68
1 changed files with 3 additions and 1 deletions
|
|
@ -506,11 +506,13 @@ impl Csharp {
|
|||
}
|
||||
let mut child = command.stdin(Stdio::piped()).stdout(Stdio::piped()).spawn().expect("dotnet runs the interop peer");
|
||||
let mut lines = BufReader::new(child.stdout.take().unwrap()).lines();
|
||||
let mut said = Vec::new();
|
||||
let port = loop {
|
||||
let line = lines.next().expect("the peer announces its port").unwrap();
|
||||
let line = lines.next().unwrap_or_else(|| panic!("the peer ended without announcing its port; it said {said:?}")).unwrap();
|
||||
if let Some(rest) = line.strip_prefix("listening ") {
|
||||
break rest.trim().parse::<u16>().unwrap();
|
||||
}
|
||||
said.push(line);
|
||||
};
|
||||
Self { child, port }
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue