diff --git a/Test/Tests/RealtimeClientConnectionTests.swift b/Test/Tests/RealtimeClientConnectionTests.swift index e212f055d..c4c962738 100644 --- a/Test/Tests/RealtimeClientConnectionTests.swift +++ b/Test/Tests/RealtimeClientConnectionTests.swift @@ -2098,6 +2098,7 @@ class RealtimeClientConnectionTests: XCTestCase { let test = Test() let options = try AblyTests.commonAppSetup(for: test) options.autoConnect = false + options.logLevel = .debug; options.testOptions.transportFactory = TestProxyTransportFactory() let tokenTtl = 3.0 let tokenDetails = try getTestTokenDetails(for: test, key: options.key, capability: nil, ttl: tokenTtl) @@ -2136,17 +2137,18 @@ class RealtimeClientConnectionTests: XCTestCase { let test = Test() let options = try AblyTests.clientOptions(for: test) options.autoConnect = false + options.logLevel = .debug; let tokenTtl = 1.0 options.token = try getTestToken(for: test, ttl: tokenTtl) options.testOptions.transportFactory = TestProxyTransportFactory() // Let the token expire waitUntil(timeout: testTimeout) { done in - delay(tokenTtl + AblyTests.tokenExpiryTolerance+10.0) { + delay(tokenTtl + AblyTests.tokenExpiryTolerance) { done() } } - + let client = ARTRealtime(options: options) defer { client.dispose() @@ -2159,7 +2161,7 @@ class RealtimeClientConnectionTests: XCTestCase { client.connection.on { stateChange in let state = stateChange.current let errorInfo = stateChange.reason - print("got state change state:") + print("got state change state: \(stateChange.current)") print(stateChange.current) switch state { case .connected: @@ -2169,6 +2171,7 @@ class RealtimeClientConnectionTests: XCTestCase { guard let errorInfo = errorInfo else { fail("ErrorInfo is nil"); done(); return } + print("got errorInfo.code=\(errorInfo.code)") XCTAssertEqual(errorInfo.code, ARTErrorCode.tokenExpired.intValue) done() default: @@ -2181,8 +2184,9 @@ class RealtimeClientConnectionTests: XCTestCase { let failures = transport.protocolMessagesReceived.filter { $0.action == .error } + print("failures.count=\(failures.count)") if failures.count != 1 { - fail("Should have only one connection request fail") + fail("Should have only one connection request fail, got \(failures.count)") return }