1111
1212from cassandra import ConsistencyLevel
1313from cassandra .concurrent import execute_concurrent_with_args
14+ from cassandra .query import SimpleStatement
1415from ccmlib .node import NodeError , TimeoutError , ToolError , Node
1516
1617import pytest
@@ -257,13 +258,14 @@ def test_read_from_bootstrapped_node(self):
257258
258259 session = self .patient_cql_connection (node1 )
259260 stress_table = 'keyspace1.standard1'
260- original_rows = list (session .execute ("SELECT * FROM %s" % (stress_table ,)))
261+ query = SimpleStatement ("SELECT * FROM %s" % (stress_table ), consistency_level = ConsistencyLevel .ALL )
262+ original_rows = list (session .execute (query ))
261263
262264 node4 = new_node (cluster )
263265 node4 .start (wait_for_binary_proto = True )
264266
265267 session = self .patient_exclusive_cql_connection (node4 )
266- new_rows = list (session .execute ("SELECT * FROM %s" % ( stress_table ,) ))
268+ new_rows = list (session .execute (query ))
267269 assert original_rows == new_rows
268270
269271 @since ('3.0' )
@@ -525,15 +527,16 @@ def test_manual_bootstrap(self):
525527 session = self .patient_exclusive_cql_connection (node2 )
526528 stress_table = 'keyspace1.standard1'
527529
528- original_rows = list (session .execute ("SELECT * FROM %s" % stress_table ))
530+ query = SimpleStatement ("SELECT * FROM %s" % stress_table , consistency_level = ConsistencyLevel .ALL )
531+ original_rows = list (session .execute (query ))
529532
530533 # Add a new node
531534 node3 = new_node (cluster , bootstrap = False )
532535 node3 .start (wait_for_binary_proto = True )
533536 node3 .repair ()
534537 node1 .cleanup ()
535538
536- current_rows = list (session .execute ("SELECT * FROM %s" % stress_table ))
539+ current_rows = list (session .execute (query ))
537540 assert original_rows == current_rows
538541
539542 def test_local_quorum_bootstrap (self ):
@@ -626,14 +629,15 @@ def _wiped_node_cannot_join_test(self, gently):
626629 node1 .stress (['write' , 'n=10K' , 'no-warmup' , '-rate' , 'threads=8' ])
627630
628631 session = self .patient_cql_connection (node1 )
629- original_rows = list (session .execute ("SELECT * FROM {}" .format (stress_table ,)))
632+ query = SimpleStatement ("SELECT * FROM {}" .format (stress_table ), consistency_level = ConsistencyLevel .ALL )
633+ original_rows = list (session .execute (query ))
630634
631635 # Add a new node, bootstrap=True ensures that it is not a seed
632636 node4 = new_node (cluster , bootstrap = True )
633637 node4 .start (wait_for_binary_proto = True )
634638
635639 session = self .patient_cql_connection (node4 )
636- assert original_rows == list (session .execute ("SELECT * FROM {}" . format ( stress_table ,) ))
640+ assert original_rows == list (session .execute (query ))
637641
638642 # Stop the new node and wipe its data
639643 node4 .stop (gently = gently )
@@ -660,14 +664,15 @@ def test_decommissioned_wiped_node_can_join(self):
660664 node1 .stress (['write' , 'n=10K' , 'no-warmup' , '-rate' , 'threads=8' ])
661665
662666 session = self .patient_cql_connection (node1 )
663- original_rows = list (session .execute ("SELECT * FROM {}" .format (stress_table ,)))
667+ query = SimpleStatement ("SELECT * FROM {}" .format (stress_table ), consistency_level = ConsistencyLevel .ALL )
668+ original_rows = list (session .execute (query ))
664669
665670 # Add a new node, bootstrap=True ensures that it is not a seed
666671 node4 = new_node (cluster , bootstrap = True )
667672 node4 .start (wait_for_binary_proto = True )
668673
669674 session = self .patient_cql_connection (node4 )
670- assert original_rows == list (session .execute ("SELECT * FROM {}" . format ( stress_table ,) ))
675+ assert original_rows == list (session .execute (query ))
671676
672677 # Decommission the new node and wipe its data
673678 node4 .decommission ()
@@ -742,7 +747,7 @@ def test_failed_bootstrap_wiped_node_can_join(self):
742747 node1 .flush ()
743748
744749 session = self .patient_cql_connection (node1 )
745- original_rows = list (session .execute ("SELECT * FROM {}" .format (stress_table , )))
750+ original_rows = list (session .execute ("SELECT * FROM {}" .format (stress_table )))
746751
747752 # Add a new node, bootstrap=True ensures that it is not a seed
748753 node2 = new_node (cluster , bootstrap = True )
0 commit comments