Added some tests around network partitioning, closing connections and …#819
Conversation
d2f5faf to
0f6f6b8
Compare
mambocab
left a comment
There was a problem hiding this comment.
nothing but nits here, except for a small question about putting things in tests vs tearDown.
| # In this case HostConnection._replace shouldn't be called | ||
| self.assertNotIn("_replace", executor.called_functions) | ||
|
|
||
| clear_queries() |
There was a problem hiding this comment.
Since this is handled in the tearDown, is this necessary? and if it's necessary for the assertion below, could you leave a comment saying so?
|
|
||
| self.addCleanup(cluster.shutdown) | ||
|
|
||
| time_to_wait_for = 20 |
There was a problem hiding this comment.
nit: I don't think this intermediate variable is necessary. I think the test docs make it clear what this sleep is for.
| """ | ||
| Test to ensure that the connections aren't closed if there's an | ||
| OperationTimedOut in a normal query. This should only happen from the | ||
| HearBeatThread (in the case of a OperationTimedOut) with the default |
There was a problem hiding this comment.
nit: I think we just want "heartbeat thread" here.
| """ | ||
| if then: | ||
| rows = None | ||
| column_types = None |
There was a problem hiding this comment.
This should probably do something more like
nose.tools.assert_is_none(rows)
nose.tools.assert_is_none(column_types)-- we'd rather have failures than silently drop arguments IMO.
| session = cluster.connect(wait_for_all_pools=True) | ||
| cluster.register_listener(listener) | ||
|
|
||
| number_of_queries = 10 |
There was a problem hiding this comment.
nit: same here as above -- is this intermediate variable necessary?
379f7f6 to
7bbbc38
Compare
…cluster._retry and idle connections with simulacron
7bbbc38 to
5c77d93
Compare
…cluster._retry and idle connections with simulacron