Skip to content

Commit

Permalink
tests/integration: handle new format for duration options
Browse files Browse the repository at this point in the history
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
  • Loading branch information
fruch committed Nov 14, 2024
1 parent 5d3ffda commit 4536002
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/integration/standard/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import unittest
import logging
import pytest
from packaging.version import Version

from cassandra import ProtocolVersion
from cassandra import ConsistencyLevel, Unavailable, InvalidRequest, cluster
from cassandra.query import (PreparedStatement, BoundStatement, SimpleStatement,
Expand All @@ -26,7 +28,7 @@
from cassandra.policies import HostDistance, RoundRobinPolicy, WhiteListRoundRobinPolicy
from tests.integration import use_singledc, PROTOCOL_VERSION, BasicSharedKeyspaceUnitTestCase, \
greaterthanprotocolv3, MockLoggingHandler, get_supported_protocol_versions, local, get_cluster, setup_keyspace, \
USE_CASS_EXTERNAL, greaterthanorequalcass40, DSE_VERSION, TestCluster, requirecassandra, xfail_scylla
USE_CASS_EXTERNAL, greaterthanorequalcass40, DSE_VERSION, TestCluster, requirecassandra, xfail_scylla, CASSANDRA_VERSION
from tests import notwindows
from tests.integration import greaterthanorequalcass30, get_node

Expand All @@ -47,7 +49,10 @@ def setup_module():
ccm_cluster.stop()
# This is necessary because test_too_many_statements may
# timeout otherwise
config_options = {'write_request_timeout_in_ms': '20000'}
if CASSANDRA_VERSION >= Version('4.1'):
config_options = {'write_request_timeout': '20000ms'}
else:
config_options = {'write_request_timeout_in_ms': '20000'}
ccm_cluster.set_configuration_options(config_options)
ccm_cluster.start(wait_for_binary_proto=True, wait_other_notice=True)

Expand Down

0 comments on commit 4536002

Please sign in to comment.