Skip to content
This repository was archived by the owner on Apr 27, 2021. It is now read-only.

Commit 4fba551

Browse files
committed
Fixing various unstable tests
1 parent f89df3f commit 4fba551

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

tests/integration/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ def get_unsupported_upper_protocol():
218218
lessthancass30 = unittest.skipUnless(CASSANDRA_VERSION < '3.0', 'Cassandra version less then 3.0 required')
219219
dseonly = unittest.skipUnless(DSE_VERSION, "Test is only applicalbe to DSE clusters")
220220
pypy = unittest.skipUnless(platform.python_implementation() == "PyPy", "Test is skipped unless it's on PyPy")
221+
notpy3 = unittest.skipIf(sys.version_info >= (3, 0), "Test not applicable for Python 3.x runtime")
221222

222223

223224
def wait_for_node_socket(node, timeout):
@@ -546,7 +547,7 @@ def create_keyspace(cls, rf):
546547
@classmethod
547548
def common_setup(cls, rf, keyspace_creation=True, create_class_table=False, metrics=False):
548549
cls.cluster = Cluster(protocol_version=PROTOCOL_VERSION, metrics_enabled=metrics)
549-
cls.session = cls.cluster.connect()
550+
cls.session = cls.cluster.connect(wait_for_all_pools=True)
550551
cls.ks_name = cls.__name__.lower()
551552
if keyspace_creation:
552553
cls.create_keyspace(rf)

tests/integration/standard/test_connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def wait_for_connections(self, host, cluster):
162162

163163
def wait_for_no_connections(self, host, cluster):
164164
retry = 0
165-
while(retry < 100):
165+
while(retry < 200):
166166
retry += 1
167167
connections = self.fetch_connections(host, cluster)
168168
if len(connections) is 0:

tests/integration/standard/test_query.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from cassandra.cluster import Cluster, NoHostAvailable
2727
from cassandra.policies import HostDistance, RoundRobinPolicy
2828
from tests.unit.cython.utils import notcython
29-
from tests.integration import use_singledc, PROTOCOL_VERSION, BasicSharedKeyspaceUnitTestCase, get_server_versions, greaterthanprotocolv3, MockLoggingHandler, get_supported_protocol_versions
29+
from tests.integration import use_singledc, PROTOCOL_VERSION, BasicSharedKeyspaceUnitTestCase, get_server_versions, greaterthanprotocolv3, MockLoggingHandler, get_supported_protocol_versions, notpy3
3030

3131
import time
3232
import re
@@ -71,6 +71,7 @@ def test_trace_prints_okay(self):
7171
str(event)
7272

7373
@notcython
74+
@notpy3
7475
def test_row_error_message(self):
7576
"""
7677
Test to validate, new column deserialization message
@@ -483,7 +484,7 @@ def setUp(self):
483484
self.cluster = Cluster(protocol_version=PROTOCOL_VERSION)
484485
if PROTOCOL_VERSION < 3:
485486
self.cluster.set_core_connections_per_host(HostDistance.LOCAL, 1)
486-
self.session = self.cluster.connect()
487+
self.session = self.cluster.connect(wait_for_all_pools=True)
487488

488489
def tearDown(self):
489490
self.cluster.shutdown()

0 commit comments

Comments
 (0)