Skip to content

Commit

Permalink
Move upgrade tests under integration
Browse files Browse the repository at this point in the history
  • Loading branch information
beltran committed Nov 17, 2017
1 parent 5a32cdf commit 4ceea3e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/integration/__init__.py
Expand Up @@ -263,7 +263,7 @@ def get_unsupported_upper_protocol():
notpy3 = unittest.skipIf(sys.version_info >= (3, 0), "Test not applicable for Python 3.x runtime")
requiresmallclockgranularity = unittest.skipIf("Windows" in platform.system() or "async" in EVENT_LOOP_MANAGER,
"This test is not suitible for environments with large clock granularity")
requiressimulacron = unittest.skipIf(SIMULACRON_JAR is None, "Simulacron jar hasn't been specified")
requiressimulacron = unittest.skipIf(SIMULACRON_JAR is None or CASSANDRA_VERSION < "2.1", "Simulacron jar hasn't been specified or C* version is 2.0")


def wait_for_node_socket(node, timeout):
Expand Down
11 changes: 6 additions & 5 deletions tests/integration/simulacron/test_policies.py
Expand Up @@ -21,7 +21,8 @@
from cassandra.query import SimpleStatement
from cassandra.policies import ConstantSpeculativeExecutionPolicy, RoundRobinPolicy, RetryPolicy, WriteType

from tests.integration import PROTOCOL_VERSION, greaterthancass21, requiressimulacron, SIMULACRON_JAR
from tests.integration import PROTOCOL_VERSION, greaterthancass21, requiressimulacron, SIMULACRON_JAR, \
CASSANDRA_VERSION
from tests.integration.simulacron.utils import start_and_prime_singledc, prime_query, \
stop_simulacron, NO_THEN, clear_queries

Expand All @@ -45,7 +46,7 @@ class SpecExecTest(unittest.TestCase):

@classmethod
def setUpClass(cls):
if SIMULACRON_JAR is None:
if SIMULACRON_JAR is None or CASSANDRA_VERSION < "2.1":
return

start_and_prime_singledc()
Expand All @@ -70,7 +71,7 @@ def setUpClass(cls):

@classmethod
def tearDownClass(cls):
if SIMULACRON_JAR is None:
if SIMULACRON_JAR is None or CASSANDRA_VERSION < "2.1":
return

cls.cluster.shutdown()
Expand Down Expand Up @@ -181,7 +182,7 @@ def on_write_timeout(self, query, consistency, write_type,
class RetryPolicyTets(unittest.TestCase):
@classmethod
def setUpClass(cls):
if SIMULACRON_JAR is None:
if SIMULACRON_JAR is None or CASSANDRA_VERSION < "2.1":
return
start_and_prime_singledc()

Expand All @@ -191,7 +192,7 @@ def setUpClass(cls):

@classmethod
def tearDownClass(cls):
if SIMULACRON_JAR is None:
if SIMULACRON_JAR is None or CASSANDRA_VERSION < "2.1":
return
cls.cluster.shutdown()
stop_simulacron()
Expand Down
File renamed without changes.
Expand Up @@ -18,7 +18,7 @@
from cassandra.auth import PlainTextAuthProvider, SaslAuthProvider
from cassandra.cluster import ConsistencyLevel, Cluster, DriverException, ExecutionProfile
from cassandra.policies import ConstantSpeculativeExecutionPolicy
from tests.integration.long.upgrade import UpgradeBase, UpgradeBaseAuth, UpgradePath, upgrade_paths
from tests.integration.upgrade import UpgradeBase, UpgradeBaseAuth, UpgradePath, upgrade_paths

try:
import unittest2 as unittest
Expand Down Expand Up @@ -140,7 +140,9 @@ def test_schema_metadata_gets_refreshed(self):
self.cluster_driver.refresh_schema_metadata(max_schema_agreement_wait=10)

self.upgrade_node(nodes[0])
self.cluster_driver.refresh_schema_metadata(max_schema_agreement_wait=20)
# Wait for the control connection to reconnect
time.sleep(20)
self.cluster_driver.refresh_schema_metadata(max_schema_agreement_wait=40)
self.assertNotEqual(original_meta, self.cluster_driver.metadata.keyspaces)

@two_to_three_path
Expand Down

0 comments on commit 4ceea3e

Please sign in to comment.