Skip to content
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

RTN15a #244

Merged
merged 3 commits into from
Mar 2, 2016
Merged

RTN15a #244

merged 3 commits into from
Mar 2, 2016

Conversation

ricardopereira
Copy link
Contributor

No description provided.

@ricardopereira
Copy link
Contributor Author

Well, I realised right now that what I did here is more about RTN15d.

client1.connection.on { stateChange in
switch stateChange!.current {
case .Connecting:
channel1.unsubscribe(listener1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

listener1 should still work, shouldn't it? Maybe you can instead of failing inside unconditionally, add a condition that it has reached the reconnection. That way we test that previous subscriptions still work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 551d534.

@ricardopereira
Copy link
Contributor Author

Connection state is only maintained for a brief period, up to a minute, so if a client is disconnected for a longer period connection state cannot be resumed

@tcard What do you think, should I test this? I think it's a server behaviour.

@tcard
Copy link
Contributor

tcard commented Feb 24, 2016

@ricardopereira I don't see how we could test that meaningfully. Maybe @mattheworiordan does.

@ricardopereira
Copy link
Contributor Author

I think this should be rebased with #228 fixes.


waitUntil(timeout: testTimeout) { done in
// Check the queued message
channel1.subscribe { message in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you resubscribing, you have a listener already defined above on line 1322. Also, subscribing after you're connected is not going to work because it's quite possible the message has already been received at this point.

@mattheworiordan
Copy link
Member

Connection state is only maintained for a brief period, up to a minute, so if a client is disconnected for a longer period connection state cannot be resumed

@tcard What do you think, should I test this? I think it's a server behaviour.

You're right, you can't test that behaviour. We can however test that a connection resume fails i.e. this would happen after connection state is lost. We can test this by changing the connection key explicitly so that a connection cannot be resumed

@ricardopereira
Copy link
Contributor Author

Rebased with master with changes: b274f12.

context("connection failures once CONNECTED") {

// RTN15a
it("should attempt to reconnect immediately and try to restore the connection") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this test is testing the failure condition, this description should reflect that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 6c55525.

@mattheworiordan
Copy link
Member

LGTM

@ricardopereira
Copy link
Contributor Author

@tcard PTAL

@tcard
Copy link
Contributor

tcard commented Feb 29, 2016

LGTM

ricardopereira added a commit that referenced this pull request Mar 2, 2016
@ricardopereira ricardopereira merged commit b44346a into master Mar 2, 2016
@ricardopereira ricardopereira deleted the RTN15a branch March 2, 2016 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants