-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thread safety #586
Thread safety #586
Changes from 1 commit
04ba309
f344825
4260a4c
6f4787a
b38fa55
2cfc1b1
fa43d00
1dc13f0
44bf0fe
345f16d
676c26b
8bdb646
39d8b20
7fa81ec
98c9a2f
388d6b2
5de21e9
17bca96
d533e20
b68b806
e812cda
3f9558e
8ad250f
49efb8a
3501f43
b0e5f94
257454a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3368,27 +3368,23 @@ class RealtimeClientConnection: QuickSpec { | |
let channel = client.channels.get("test") | ||
let transport = client.transport as! TestProxyTransport | ||
|
||
expect(client.connection.state).toEventually(equal(ARTRealtimeConnectionState.Connected), timeout: testTimeout) | ||
|
||
waitUntil(timeout: testTimeout) { done in | ||
channel.attach { _ in done() } | ||
} | ||
|
||
waitUntil(timeout: testTimeout) { done in | ||
transport.ignoreSends = true | ||
channel.publish(nil, data: "message") { error in | ||
expect(error).to(beNil()) | ||
guard let newTransport = client.transport as? TestProxyTransport else { | ||
fail("Transport is nil"); done(); return | ||
} | ||
expect(newTransport).toNot(beIdenticalTo(transport)) | ||
expect(transport.protocolMessagesReceived.filter{ $0.action == .Connected }).to(haveCount(1)) | ||
expect(newTransport.protocolMessagesReceived.filter{ $0.action == .Connected }).to(haveCount(1)) | ||
expect(transport.protocolMessagesSent.filter{ $0.action == .Message }).to(haveCount(0)) | ||
expect(transport.protocolMessagesSentIgnored.filter{ $0.action == .Message }).to(haveCount(1)) | ||
expect(transport.protocolMessagesReceived.filter{ $0.action == .Connected }).to(haveCount(1)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't this exactly line 3382? Unless I'm missing something, these changes make the test not test anymore what it's supposed to be testing. We want to send a message, break the connection before the message gets its ACK, connect again, and check that the message is sent again in the new connection. This is now just testing that the message is sent in the new connection, regardless of whether it was also sent in the old connection and/or it got the ACK. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done 257454a. |
||
expect(newTransport.protocolMessagesSent.filter{ $0.action == .Message }).to(haveCount(1)) | ||
done() | ||
} | ||
transport.ignoreSends = false | ||
client.onDisconnected() | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get how are we guaranteeing this in this test. Where is the old transport disconnected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old transport is the
transport
.