27
27
from cassandra .policies import HostStateListener , RoundRobinPolicy
28
28
29
29
from tests import connection_class , thread_pool_executor_class
30
- from tests .integration import PROTOCOL_VERSION , requiressimulacron
30
+ from tests .integration import requiressimulacron
31
31
from tests .integration .util import assert_quiescent_pool_state , late
32
- from tests .integration .simulacron import SimulacronBase
32
+ # important to import the patch PROTOCOL_VERSION from the simulacron module
33
+ from tests .integration .simulacron import SimulacronBase , PROTOCOL_VERSION
33
34
from cassandra .connection import DEFAULT_CQL_VERSION
34
35
from tests .unit .cython .utils import cythontest
35
36
from tests .integration .simulacron .utils import (NO_THEN , PrimeOptions ,
@@ -323,7 +324,7 @@ def test_retry_after_defunct(self):
323
324
cluster_name = "{}/{}" .format (simulacron_cluster .cluster_name , last_host ))
324
325
325
326
roundrobin_lbp = OrderedRoundRobinPolicy ()
326
- cluster = Cluster (compression = False ,
327
+ cluster = Cluster (protocol_version = PROTOCOL_VERSION , compression = False ,
327
328
idle_heartbeat_interval = idle_heartbeat_interval ,
328
329
idle_heartbeat_timeout = idle_heartbeat_timeout ,
329
330
execution_profiles = {
@@ -377,7 +378,7 @@ def test_idle_connection_is_not_closed(self):
377
378
idle_heartbeat_interval = 1
378
379
379
380
listener = TrackDownListener ()
380
- cluster = Cluster (compression = False ,
381
+ cluster = Cluster (protocol_version = PROTOCOL_VERSION , compression = False ,
381
382
idle_heartbeat_interval = idle_heartbeat_interval ,
382
383
idle_heartbeat_timeout = idle_heartbeat_timeout )
383
384
session = cluster .connect (wait_for_all_pools = True )
@@ -408,7 +409,7 @@ def test_host_is_not_set_to_down_after_query_oto(self):
408
409
prime_query (query_to_prime , then = NO_THEN )
409
410
410
411
listener = TrackDownListener ()
411
- cluster = Cluster (compression = False )
412
+ cluster = Cluster (protocol_version = PROTOCOL_VERSION , compression = False )
412
413
session = cluster .connect (wait_for_all_pools = True )
413
414
cluster .register_listener (listener )
414
415
@@ -429,7 +430,8 @@ def test_can_shutdown_connection_subclass(self):
429
430
class ExtendedConnection (connection_class ):
430
431
pass
431
432
432
- cluster = Cluster (contact_points = ["127.0.0.2" ],
433
+ cluster = Cluster (protocol_version = PROTOCOL_VERSION ,
434
+ contact_points = ["127.0.0.2" ],
433
435
connection_class = ExtendedConnection ,
434
436
compression = False )
435
437
cluster .connect ()
@@ -443,7 +445,7 @@ def test_driver_recovers_nework_isolation(self):
443
445
444
446
listener = TrackDownListener ()
445
447
446
- cluster = Cluster (['127.0.0.1' ],
448
+ cluster = Cluster (protocol_version = PROTOCOL_VERSION , contact_points = ['127.0.0.1' ],
447
449
idle_heartbeat_timeout = idle_heartbeat_timeout ,
448
450
idle_heartbeat_interval = idle_heartbeat_interval ,
449
451
executor_threads = 16 ,
0 commit comments