Skip to content

Commit 6070cee

Browse files
authored
test: fix flaky test test_subscription_lagged_error (#239)
1 parent b25d02c commit 6070cee

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/robust_provider/subscription.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,10 @@ mod tests {
10151015
// Mine more blocks than channel can hold without consuming
10161016
provider.anvil_mine(Some(MAX_CHANNEL_SIZE as u64 + 1), None).await?;
10171017

1018+
// Allow time for block notifications to propagate through WebSocket
1019+
// and fill the subscription channel
1020+
sleep(BUFFER_TIME).await;
1021+
10181022
// First recv should return Lagged error (skipped some blocks)
10191023
let result = subscription.recv().await;
10201024
assert!(matches!(result, Err(Error::Lagged(_))));

0 commit comments

Comments
 (0)