This is an automated email from the ASF dual-hosted git repository.

samt pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-dtest.git


The following commit(s) were added to refs/heads/trunk by this push:
     new c6d2262  Update dtests following CASSANDRA-14973 (#127)
c6d2262 is described below

commit c6d226254f105b4530072c09699cb0422374e54c
Author: Sam Tunnicliffe <[email protected]>
AuthorDate: Thu Feb 25 19:49:02 2021 +0000

    Update dtests following CASSANDRA-14973 (#127)
    
    * Specify v5 for pushed notification test if available
    * Add v5 to cqlsh protocol negotiation test
    * Default to v5 for 4.0
    
    Patch by Sam Tunnicliffe; reviewed by Brandon Williams for CASSANDRA-14973
---
 cqlsh_tests/test_cqlsh.py    | 8 +++++++-
 dtest.py                     | 4 +++-
 pushed_notifications_test.py | 4 ++--
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/cqlsh_tests/test_cqlsh.py b/cqlsh_tests/test_cqlsh.py
index 39a1a2b..fa1edad 100644
--- a/cqlsh_tests/test_cqlsh.py
+++ b/cqlsh_tests/test_cqlsh.py
@@ -1864,9 +1864,15 @@ Tracing session:""")
 
         node1, = self.cluster.nodelist()
         stdout, stderr = self.run_cqlsh(node1, cmds='USE system', 
cqlsh_options=['--tty'])
+        if node1.get_cassandra_version() < '4.0':
+            assert "Native protocol v4" in stdout
+        else:
+            assert "Native protocol v5" in stdout
+
+        stdout, stderr = self.run_cqlsh(node1, cmds='USE system', 
cqlsh_options=['--protocol-version=4', '--tty'])
         assert "Native protocol v4" in stdout
 
-        stdout, stderr = self.run_cqlsh(node1, cmds='USE systeml', 
cqlsh_options=['--protocol-version=3', '--tty'])
+        stdout, stderr = self.run_cqlsh(node1, cmds='USE system', 
cqlsh_options=['--protocol-version=3', '--tty'])
         assert "Native protocol v3" in stdout
 
     @since('3.0.19')
diff --git a/dtest.py b/dtest.py
index 9747c11..f2c89b2 100644
--- a/dtest.py
+++ b/dtest.py
@@ -276,7 +276,9 @@ def get_eager_protocol_version(cassandra_version):
     Returns the highest protocol version accepted
     by the given C* version
     """
-    if LooseVersion('3.0') <= cassandra_version:
+    if LooseVersion('4.0') <= cassandra_version:
+        protocol_version = 5
+    elif LooseVersion('3.0') <= cassandra_version:
         protocol_version = 4
     elif LooseVersion('2.1') <= cassandra_version:
         protocol_version = 3
diff --git a/pushed_notifications_test.py b/pushed_notifications_test.py
index 137f4d6..6ab311e 100644
--- a/pushed_notifications_test.py
+++ b/pushed_notifications_test.py
@@ -35,7 +35,8 @@ class NotificationWaiter(object):
         self.keyspace = keyspace
 
         # get a single, new connection
-        session = tester.patient_exclusive_cql_connection(node)
+        version = 5 if node.get_cassandra_version() >= LooseVersion('4.0') 
else None
+        session = tester.patient_exclusive_cql_connection(node, 
protocol_version=version)
         connection = session.cluster.connection_factory(self.address, 
is_control_connection=True)
 
         # coordinate with an Event
@@ -53,7 +54,6 @@ class NotificationWaiter(object):
         Called when a notification is pushed from Cassandra.
         """
         logger.debug("Got {} from {} at {}".format(notification, self.address, 
datetime.now()))
-
         if self.keyspace and notification['keyspace'] and self.keyspace != 
notification['keyspace']:
             return  # we are not interested in this schema change
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to