mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 13:24:19 +00:00
Make drop test more reliable
This commit is contained in:
parent
8e3f40bfdd
commit
0ddbe0c757
1 changed files with 9 additions and 6 deletions
|
@ -184,13 +184,16 @@ mod tests {
|
||||||
drop(client);
|
drop(client);
|
||||||
|
|
||||||
// Try sending an empty payload over and over, until the client is dropped and hangs up.
|
// Try sending an empty payload over and over, until the client is dropped and hangs up.
|
||||||
let error = loop {
|
loop {
|
||||||
match server_conn.write(&[0]).await {
|
match server_conn.write(&[]).await {
|
||||||
Ok(_) => continue,
|
Ok(_) => {}
|
||||||
Err(err) => break err,
|
Err(err) => {
|
||||||
|
if err.kind() == io::ErrorKind::BrokenPipe {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
assert_eq!(error.kind(), io::ErrorKind::BrokenPipe);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn send_recv<S, R, O>(mut sender: S, receiver: R) -> O
|
async fn send_recv<S, R, O>(mut sender: S, receiver: R) -> O
|
||||||
|
|
Loading…
Reference in a new issue