Skip to content

Commit 5635814

Browse files
Fix token cancellation flakiness (#646)
1 parent 48d6360 commit 5635814

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

data-pipeline/src/stats_exporter.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,15 +342,12 @@ mod tests {
342342
cancellation_token.clone(),
343343
);
344344

345-
tokio::time::pause();
346345
tokio::spawn(async move {
347346
stats_exporter.run().await;
348347
});
349348
// Cancel token to trigger force flush
350349
cancellation_token.cancel();
351-
// Resume time to sleep while the stats are being sent
352-
tokio::time::resume();
353-
tokio::time::sleep(Duration::from_millis(10)).await;
350+
tokio::time::sleep(Duration::from_millis(500)).await;
354351

355352
mock.assert_async().await;
356353
}

0 commit comments

Comments
 (0)