Skip to content

Fix failing test after JAVA-1431#855

Merged
tolbertam merged 3 commits into
3.xfrom
java1431-fix
Jun 13, 2017
Merged

Fix failing test after JAVA-1431#855
tolbertam merged 3 commits into
3.xfrom
java1431-fix

Conversation

@adutra

@adutra adutra commented Jun 13, 2017

Copy link
Copy Markdown
Contributor

No description provided.

@adutra adutra added this to the 3.3.0 milestone Jun 13, 2017
// more active connections
// Pool to host2 may be either closed because host2 was marked down before initialization
// was complete, or open and empty, if host2 was marked down after.
Session.State state = session.getState();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this is good, but alternatively it could be good to just wait for host2 to go down before checking the session state (TestUtils.waitForDown("2", cluster);). This way we ensure that a side effect of the exception being raised is that the host is marked down and the pool is ultimately closed (the same assertions we had before can be maintained).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I tried exactly that, but it doesn't work, I'm still getting two connected hosts instead of one.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, nvm, I was being stupid. I need to get the session state after the node is marked down. That is why I was still getting two connected hosts.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Indeed that works provided that the state is obtained after the host is marked down. Thanks!

@tolbertam tolbertam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks great 👍

@tolbertam tolbertam merged commit 5f856df into 3.x Jun 13, 2017
@tolbertam tolbertam deleted the java1431-fix branch June 13, 2017 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants