Skip to content

Commit 1bc0cf9

Browse files
author
bjmb
committed
Updated build.yaml
1 parent 4bec824 commit 1bc0cf9

3 files changed

Lines changed: 30 additions & 14 deletions

File tree

build.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ python:
1010
os:
1111
- ubuntu/trusty64
1212
cassandra:
13-
- 2.0
14-
- 2.1
15-
- 2.2
16-
- 3.0
17-
- 3.10
13+
- '2.0'
14+
- '2.1'
15+
- '2.2'
16+
- '3.0'
17+
- '3.11'
1818
env:
1919
EVENT_LOOP_MANAGER:
2020
- libev

tests/integration/long/test_failure_types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ def _perform_cql_statement(self, text, consistency_level, expected_exception, se
157157
self.execute_helper(session, statement)
158158
if self.support_v5 and (isinstance(cm.exception, WriteFailure) or isinstance(cm.exception, ReadFailure)):
159159
if isinstance(cm.exception, ReadFailure):
160-
self.assertEqual(cm.exception.error_code_map.values()[0], 1)
160+
self.assertEqual(list(cm.exception.error_code_map.values())[0], 1)
161161
else:
162-
self.assertEqual(cm.exception.error_code_map.values()[0], 0)
162+
self.assertEqual(list(cm.exception.error_code_map.values())[0], 0)
163163

164164
def test_write_failures_from_coordinator(self):
165165
"""

tests/integration/standard/test_query.py

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,29 @@
2020
except ImportError:
2121
import unittest # noqa
2222
import logging
23+
from cassandra import ProtocolVersion
2324
from cassandra import ConsistencyLevel, Unavailable, InvalidRequest, cluster
2425
from cassandra.query import (PreparedStatement, BoundStatement, SimpleStatement,
2526
BatchStatement, BatchType, dict_factory, TraceUnavailable)
2627
from cassandra.cluster import Cluster, NoHostAvailable
2728
from cassandra.policies import HostDistance, RoundRobinPolicy
2829
from tests.integration import use_singledc, PROTOCOL_VERSION, BasicSharedKeyspaceUnitTestCase, get_server_versions, \
29-
greaterthanprotocolv3, MockLoggingHandler, get_supported_protocol_versions, local
30+
greaterthanprotocolv3, MockLoggingHandler, get_supported_protocol_versions, local, get_cluster, setup_keyspace
3031
from tests import notwindows
3132

3233
import time
3334
import re
3435

35-
3636
def setup_module():
37-
use_singledc()
37+
use_singledc(start=False)
38+
ccm_cluster = get_cluster()
39+
ccm_cluster.clear()
40+
# This is necessary because test_too_many_statements may
41+
# timeout otherwise
42+
config_options = {'write_request_timeout_in_ms': '20000'}
43+
ccm_cluster.set_configuration_options(config_options)
44+
ccm_cluster.start(wait_for_binary_proto=True, wait_other_notice=True)
45+
setup_keyspace()
3846
global CASS_SERVER_VERSION
3947
CASS_SERVER_VERSION = get_server_versions()[0]
4048

@@ -424,7 +432,9 @@ def test_prepared_metadata_generation(self):
424432

425433
base_line = None
426434
for proto_version in get_supported_protocol_versions():
427-
cluster = Cluster(protocol_version=proto_version)
435+
beta_flag = True if proto_version in ProtocolVersion.BETA_VERSIONS else False
436+
cluster = Cluster(protocol_version=proto_version, allow_beta_protocol_version=beta_flag)
437+
428438
session = cluster.connect()
429439
select_statement = session.prepare("SELECT * FROM system.local")
430440
if proto_version == 1:
@@ -462,10 +472,16 @@ def test_prepare_on_all_hosts(self):
462472
mock_handler = MockLoggingHandler()
463473
logger = logging.getLogger(cluster.__name__)
464474
logger.addHandler(mock_handler)
475+
self.assertGreaterEqual(len(clus.metadata.all_hosts()), 3)
465476
select_statement = session.prepare("SELECT * FROM system.local")
466-
session.execute(select_statement)
467-
session.execute(select_statement)
468-
session.execute(select_statement)
477+
reponse_first = session.execute(select_statement)
478+
reponse_second = session.execute(select_statement)
479+
reponse_third = session.execute(select_statement)
480+
481+
self.assertEqual(len({reponse_first.response_future.attempted_hosts[0],
482+
reponse_second.response_future.attempted_hosts[0],
483+
reponse_third.response_future.attempted_hosts[0]}), 3)
484+
469485
self.assertEqual(2, mock_handler.get_message_count('debug', "Re-preparing"))
470486
finally:
471487
clus.shutdown()

0 commit comments

Comments
 (0)