Raise positive waitUntil timeouts to 5s for loaded CI runners (#1340)

NoiseCoverageTests' session-callback test failed on the first CI run
that actually executed it (every run since it landed had hung and been
killed before completion): onSessionEstablished fires via
DispatchQueue.global().async, and the test waited only 0.5s — fine on
a dev machine, too tight on a loaded CI runner saturated by parallel
test workers.

Raise every positive-wait timeout from 0.5s to 5s (matching
TestConstants.defaultTimeout) across the suites that poll for async
callbacks. waitUntil returns as soon as the condition holds, so
passing runs are unaffected; only genuine failures wait longer. The
two negative waits in BLEServiceCoreTests ("expect nothing arrives")
deliberately keep their short windows.

Co-authored-by: jack <jackjackbits@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
jack
2026-06-12 10:08:42 +02:00
committed by GitHub
co-authored by jack Claude Fable 5
parent 9dc0ba6991
commit 97bc3f53bc
5 changed files with 17 additions and 17 deletions
@@ -101,7 +101,7 @@ struct NoiseEncryptionServiceTests {
try establishSessions(alice: alice, bob: bob, alicePeerID: alicePeerID, bobPeerID: bobPeerID)
let authenticated = await TestHelpers.waitUntil({ recorder.count >= 2 }, timeout: 0.5)
let authenticated = await TestHelpers.waitUntil({ recorder.count >= 2 }, timeout: 5.0)
#expect(authenticated)
#expect(alice.hasEstablishedSession(with: alicePeerID))
#expect(bob.hasEstablishedSession(with: bobPeerID))
@@ -79,7 +79,7 @@ struct NostrTransportTests {
)
notificationCenter.post(name: .favoriteStatusChanged, object: nil)
let didRefresh = await TestHelpers.waitUntil({ transport.isPeerReachable(peerID) }, timeout: 0.5)
let didRefresh = await TestHelpers.waitUntil({ transport.isPeerReachable(peerID) }, timeout: 5.0)
#expect(didRefresh)
}
@@ -116,7 +116,7 @@ struct NostrTransportTests {
transport.sendPrivateMessage("hello over nostr", to: shortPeerID, recipientNickname: "Carol", messageID: "pm-1")
let didSend = await TestHelpers.waitUntil({ probe.sentEvents.count == 1 }, timeout: 0.5)
let didSend = await TestHelpers.waitUntil({ probe.sentEvents.count == 1 }, timeout: 5.0)
#expect(didSend)
let result = try decodeEmbeddedPayload(from: probe.sentEvents[0], recipient: recipient)
let privateMessage = try decodePrivateMessage(from: result.payload)
@@ -161,7 +161,7 @@ struct NostrTransportTests {
transport.sendFavoriteNotification(to: fullPeerID, isFavorite: true)
let didSend = await TestHelpers.waitUntil({ probe.sentEvents.count == 1 }, timeout: 0.5)
let didSend = await TestHelpers.waitUntil({ probe.sentEvents.count == 1 }, timeout: 5.0)
#expect(didSend)
let result = try decodeEmbeddedPayload(from: probe.sentEvents[0], recipient: recipient)
let privateMessage = try decodePrivateMessage(from: result.payload)
@@ -202,7 +202,7 @@ struct NostrTransportTests {
transport.sendDeliveryAck(for: "ack-1", to: fullPeerID)
let didSend = await TestHelpers.waitUntil({ probe.sentEvents.count == 1 }, timeout: 0.5)
let didSend = await TestHelpers.waitUntil({ probe.sentEvents.count == 1 }, timeout: 5.0)
#expect(didSend)
let result = try decodeEmbeddedPayload(from: probe.sentEvents[0], recipient: recipient)
@@ -240,7 +240,7 @@ struct NostrTransportTests {
messageID: "geo-1"
)
let didSend = await TestHelpers.waitUntil({ probe.sentEvents.count == 1 }, timeout: 0.5)
let didSend = await TestHelpers.waitUntil({ probe.sentEvents.count == 1 }, timeout: 5.0)
#expect(didSend)
let event = probe.sentEvents[0]
let result = try decodeEmbeddedPayload(from: event, recipient: recipient)
@@ -24,7 +24,7 @@ struct TransferProgressManagerTests {
let didReceive = await TestHelpers.waitUntil({
recorder.values == ["started:\(transferID):3"]
}, timeout: 0.5)
}, timeout: 5.0)
#expect(didReceive)
#expect(recorder.values == ["started:\(transferID):3"])
@@ -59,7 +59,7 @@ struct TransferProgressManagerTests {
let didReceive = await TestHelpers.waitUntil({
recorder.values.count == 3
}, timeout: 0.5)
}, timeout: 5.0)
#expect(didReceive)
#expect(recorder.values == [
@@ -97,7 +97,7 @@ struct TransferProgressManagerTests {
let didReceive = await TestHelpers.waitUntil({
recorder.values.contains("started:\(transferID):4") &&
recorder.values.contains("cancelled:\(transferID):1:4")
}, timeout: 0.5)
}, timeout: 5.0)
#expect(didReceive)
#expect(recorder.values.contains("started:\(transferID):4"))