mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 07:14:47 -05:00
chore: speed up test_multi_task test on Windows (#23737)
Previously it was around 30s to run: 1024*2*15 = 30720ms
This commit is contained in:
parent
5e6c72d39f
commit
0e9b7f64f7
1 changed files with 7 additions and 1 deletions
|
@ -650,7 +650,13 @@ mod tests {
|
|||
// Slightly slower reader
|
||||
let b = deno_core::unsync::spawn(async move {
|
||||
for _ in 0..BUFFER_CHANNEL_SIZE * 2 {
|
||||
if cfg!(windows) {
|
||||
// windows has ~15ms resolution on sleep, so just yield so
|
||||
// this test doesn't take 30 seconds to run
|
||||
tokio::task::yield_now().await;
|
||||
} else {
|
||||
tokio::time::sleep(Duration::from_millis(1)).await;
|
||||
}
|
||||
poll_fn(|cx| channel.poll_read_ready(cx)).await;
|
||||
channel.read(BUFFER_AGGREGATION_LIMIT).unwrap();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue