Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions tests/runtime-adapter/tests/vm_clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4233,10 +4233,13 @@ fn a_clone_whose_mapping_fails_ends_before_its_sandbox_starts() {
/// it did, or until `stop`, and returns whether it did: it reads the listener's greeting, answers
/// it, closes its side, and reads to the end. A connection that ends without the greeting, as
/// OpenVMM's do while the guest does not listen yet, or where it admits no connection of the host,
/// is retried.
/// is retried. Each attempt to connect runs until it opens or fails: Windows retries a loopback
/// connection that nothing accepts every half second for about two seconds, so an attempt that a
/// timeout gave up on could still open once OpenVMM publishes the listener, which would then take
/// that connection, already closed, for its one client.
fn reach_guest(address: SocketAddr, stop: &AtomicBool) -> bool {
while !stop.load(Ordering::SeqCst) {
if let Ok(mut stream) = TcpStream::connect_timeout(&address, Duration::from_secs(1)) {
if let Ok(mut stream) = TcpStream::connect(address) {
stream
.set_read_timeout(Some(Duration::from_secs(5)))
.unwrap();
Expand Down
8 changes: 6 additions & 2 deletions tests/runtime-adapter/tests/vm_layered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3011,10 +3011,14 @@ fn check_guest_listener(vm: &mut Vm<'_>, address: SocketAddr, reached: bool) {
/// Tries to exchange a line each way with a listener of the guest through `address`, until it did,
/// or until `stop`, and returns whether it did: it reads the listener's greeting, answers it,
/// closes its side, and reads to the end. A connection that ends without the greeting, as
/// OpenVMM's do while the guest does not listen yet, is retried.
/// OpenVMM's do while the guest does not listen yet, is retried. Each attempt to connect runs
/// until it opens or fails: Windows retries a loopback connection that nothing accepts every half
/// second for about two seconds, so an attempt that a timeout gave up on could still open once
/// OpenVMM publishes the listener, which would then take that connection, already closed, for its
/// one client.
fn reach_guest(address: SocketAddr, stop: &AtomicBool) -> bool {
while !stop.load(Ordering::SeqCst) {
if let Ok(mut stream) = TcpStream::connect_timeout(&address, Duration::from_secs(1)) {
if let Ok(mut stream) = TcpStream::connect(address) {
stream
.set_read_timeout(Some(Duration::from_secs(5)))
.unwrap();
Expand Down
Loading