Skip to content

Commit 112fcd9

Browse files
committed
Improve CI robustness for websocket rapid reconnect tests
1 parent ef0ab93 commit 112fcd9

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

crates/adapters/bitmex/tests/websocket.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,7 +1239,7 @@ async fn test_reconnection_retries_failed_subscriptions() {
12391239
client.wait_until_active(10.0).await.unwrap();
12401240
wait_for_connection_count(&state, 1, Duration::from_secs(5)).await;
12411241

1242-
let first_events = wait_for_subscription_events(&state, Duration::from_secs(8), |events| {
1242+
let first_events = wait_for_subscription_events(&state, Duration::from_secs(20), |events| {
12431243
let instrument_ok = events
12441244
.iter()
12451245
.any(|(topic, ok)| topic == "instrument" && *ok);
@@ -1283,7 +1283,7 @@ async fn test_reconnection_retries_failed_subscriptions() {
12831283
client.wait_until_active(10.0).await.unwrap();
12841284
wait_for_connection_count(&state, 1, Duration::from_secs(5)).await;
12851285

1286-
let second_events = wait_for_subscription_events(&state, Duration::from_secs(8), |events| {
1286+
let second_events = wait_for_subscription_events(&state, Duration::from_secs(20), |events| {
12871287
events.iter().any(|(topic, ok)| topic == "position" && *ok)
12881288
})
12891289
.await;
@@ -1516,8 +1516,8 @@ async fn test_rapid_consecutive_reconnections() {
15161516
"Reconnection cycle {cycle} failed"
15171517
);
15181518

1519-
// Wait for subscription restoration
1520-
let events = wait_for_subscription_events(&state, Duration::from_secs(8), |events| {
1519+
// Wait for subscription restoration (20s to account for slower CI runners)
1520+
let events = wait_for_subscription_events(&state, Duration::from_secs(20), |events| {
15211521
events
15221522
.iter()
15231523
.any(|(topic, ok)| topic == "trade:XBTUSD" && *ok)
@@ -1613,7 +1613,7 @@ async fn test_multiple_partial_subscription_failures() {
16131613
wait_for_connection_count(&state, 1, Duration::from_secs(5)).await;
16141614

16151615
// Wait for subscription restoration attempts
1616-
let first_events = wait_for_subscription_events(&state, Duration::from_secs(8), |events| {
1616+
let first_events = wait_for_subscription_events(&state, Duration::from_secs(20), |events| {
16171617
let trade_xbt_failed = events
16181618
.iter()
16191619
.any(|(topic, ok)| topic == "trade:XBTUSD" && !*ok);
@@ -1684,7 +1684,7 @@ async fn test_multiple_partial_subscription_failures() {
16841684
client.wait_until_active(10.0).await.unwrap();
16851685
wait_for_connection_count(&state, 1, Duration::from_secs(5)).await;
16861686

1687-
let second_events = wait_for_subscription_events(&state, Duration::from_secs(8), |events| {
1687+
let second_events = wait_for_subscription_events(&state, Duration::from_secs(20), |events| {
16881688
events
16891689
.iter()
16901690
.any(|(topic, ok)| topic == "trade:XBTUSD" && *ok)

crates/adapters/okx/tests/websocket.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,11 +1553,11 @@ async fn test_rapid_consecutive_reconnections() {
15531553
let expected = initial_login_count + cycle;
15541554
async move { *state.login_count.lock().await >= expected }
15551555
},
1556-
Duration::from_secs(5),
1556+
Duration::from_secs(8),
15571557
)
15581558
.await;
15591559

1560-
// Wait for subscription restoration
1560+
// Wait for subscription restoration (20s to account for slower CI runners)
15611561
wait_until_async(
15621562
|| {
15631563
let state = state.clone();
@@ -1571,7 +1571,7 @@ async fn test_rapid_consecutive_reconnections() {
15711571
.any(|(key, _, ok)| key.starts_with("orders") && *ok)
15721572
}
15731573
},
1574-
Duration::from_secs(8),
1574+
Duration::from_secs(20),
15751575
)
15761576
.await;
15771577

0 commit comments

Comments
 (0)