datastax/python-driver — pull request #191 by the-gigi (2014-08-28 18:39:58+00:00)
Title: Fix multiple bugs related to control connection timeout and schema refre...

...sh.

1. The Cluster's class-level 'control_connection_timeout' variable was never used
2. ControlConnection.wait_for_schema_agreement() ignored the timeout passed from Cluster and always used hard-coded 2.0
3. Still wait_for_schema_agreement() if an OperationTimeoutError occurred there was no sleep between attempts, which caused test_refresh_schema_timeout() to hang because it used FakeTime and no FakeTime ever elapsed. It is also very tight busy waiting, which is sub-optimal.

My changes are:

1. Use the Cluster's class level 'control_connection_timeout' as the default for the __init__() argument
2. In wait_for_schema_agreement() use the self._timeout (passed from Cluster) to compute the actual timeout
3. Added poll_interval = 0.2, and sleep when an operation times out before attempting again (fixes the test and makes the busy waiting more relaxed)