Skip to content

Commit

Permalink
Debug race condition on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mxinden committed Feb 13, 2024
1 parent 00f0eeb commit 6f330d3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions neqo-common/src/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ impl Socket {

#[cfg(test)]
mod tests {
use std::time::Duration;

use tokio::time::sleep;

use super::*;
use crate::{IpTos, IpTosDscp, IpTosEcn};

Expand All @@ -126,6 +130,8 @@ mod tests {
let receiver_addr: SocketAddr = "127.0.0.1:8080".parse().unwrap();
let receiver = Socket::bind(receiver_addr)?;

sleep(Duration::from_millis(100)).await;

let tos_tx = IpTos::from((IpTosDscp::Le, IpTosEcn::Ce));
let datagram = Datagram::new(
sender.local_addr()?,
Expand All @@ -138,6 +144,8 @@ mod tests {
sender.writable().await?;
sender.send(datagram.clone())?;

sleep(Duration::from_millis(100)).await;

receiver.readable().await?;
let received_datagram = receiver
.recv(&receiver_addr)
Expand Down

0 comments on commit 6f330d3

Please sign in to comment.