Skip to content

Commit

Permalink
Replaced toEventually (which has not very precise measurement of ti…
Browse files Browse the repository at this point in the history
…me intervals) with `.once(.connected)` to avoid failure `channel.state == .attaching` vs `channel.state == .attached`.
  • Loading branch information
maratal committed Oct 8, 2024
1 parent ccca241 commit 0c6144f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Test/Tests/RealtimeClientChannelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 0c6144f

Please sign in to comment.