Skip to content

Commit 4536002

Browse files
committed
tests/integration: handle new format for duration options
cassandra 4.1 and up, removed ms/min and so from name of config options, and it need to be specific in the value itself we have few tests using it, and need to be adapted
1 parent 5d3ffda commit 4536002

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/integration/standard/test_query.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
import unittest
1919
import logging
2020
import pytest
21+
from packaging.version import Version
22+
2123
from cassandra import ProtocolVersion
2224
from cassandra import ConsistencyLevel, Unavailable, InvalidRequest, cluster
2325
from cassandra.query import (PreparedStatement, BoundStatement, SimpleStatement,
@@ -26,7 +28,7 @@
2628
from cassandra.policies import HostDistance, RoundRobinPolicy, WhiteListRoundRobinPolicy
2729
from tests.integration import use_singledc, PROTOCOL_VERSION, BasicSharedKeyspaceUnitTestCase, \
2830
greaterthanprotocolv3, MockLoggingHandler, get_supported_protocol_versions, local, get_cluster, setup_keyspace, \
29-
USE_CASS_EXTERNAL, greaterthanorequalcass40, DSE_VERSION, TestCluster, requirecassandra, xfail_scylla
31+
USE_CASS_EXTERNAL, greaterthanorequalcass40, DSE_VERSION, TestCluster, requirecassandra, xfail_scylla, CASSANDRA_VERSION
3032
from tests import notwindows
3133
from tests.integration import greaterthanorequalcass30, get_node
3234

@@ -47,7 +49,10 @@ def setup_module():
4749
ccm_cluster.stop()
4850
# This is necessary because test_too_many_statements may
4951
# timeout otherwise
50-
config_options = {'write_request_timeout_in_ms': '20000'}
52+
if CASSANDRA_VERSION >= Version('4.1'):
53+
config_options = {'write_request_timeout': '20000ms'}
54+
else:
55+
config_options = {'write_request_timeout_in_ms': '20000'}
5156
ccm_cluster.set_configuration_options(config_options)
5257
ccm_cluster.start(wait_for_binary_proto=True, wait_other_notice=True)
5358

0 commit comments

Comments
 (0)