Fix failing test after JAVA-1431#855
Conversation
| // 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(); |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
I tried exactly that, but it doesn't work, I'm still getting two connected hosts instead of one.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Indeed that works provided that the state is obtained after the host is marked down. Thanks!
No description provided.