From 0c6144fec1bc678bf4eadb4323546abc189301ba Mon Sep 17 00:00:00 2001 From: Marat Al Date: Tue, 8 Oct 2024 23:28:55 +0200 Subject: [PATCH] Replaced `toEventually` (which has not very precise measurement of time intervals) with `.once(.connected)` to avoid failure `channel.state == .attaching` vs `channel.state == .attached`. --- Test/Tests/RealtimeClientChannelTests.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Test/Tests/RealtimeClientChannelTests.swift b/Test/Tests/RealtimeClientChannelTests.swift index 57c3e948d..b1db7eeba 100644 --- a/Test/Tests/RealtimeClientChannelTests.swift +++ b/Test/Tests/RealtimeClientChannelTests.swift @@ -903,7 +903,12 @@ class RealtimeClientChannelTests: XCTestCase { } } - expect(client.connection.state).toEventually(equal(ARTRealtimeConnectionState.connected), timeout: testTimeout) + waitUntil(timeout: testTimeout) { done in + client.connection.once(.connected) { stateChange in + XCTAssertNil(stateChange.reason) + done() + } + } XCTAssertEqual(channel.state, ARTRealtimeChannelState.attaching)