Addressing code review comments
This commit is contained in:
@@ -179,7 +179,7 @@ def setup_test_keyspace():
|
|||||||
try:
|
try:
|
||||||
results = session.execute("SELECT keyspace_name FROM system.schema_keyspaces")
|
results = session.execute("SELECT keyspace_name FROM system.schema_keyspaces")
|
||||||
existing_keyspaces = [row[0] for row in results]
|
existing_keyspaces = [row[0] for row in results]
|
||||||
for ksname in ('test1rf', 'test2rf', 'test3rf', 'lightw'):
|
for ksname in ('test1rf', 'test2rf', 'test3rf'):
|
||||||
if ksname in existing_keyspaces:
|
if ksname in existing_keyspaces:
|
||||||
session.execute("DROP KEYSPACE %s" % ksname)
|
session.execute("DROP KEYSPACE %s" % ksname)
|
||||||
|
|
||||||
@@ -204,17 +204,6 @@ def setup_test_keyspace():
|
|||||||
v int )'''
|
v int )'''
|
||||||
session.execute(ddl)
|
session.execute(ddl)
|
||||||
|
|
||||||
ddl = '''
|
|
||||||
CREATE KEYSPACE lightw
|
|
||||||
WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}'''
|
|
||||||
session.execute(ddl)
|
|
||||||
|
|
||||||
ddl = '''
|
|
||||||
CREATE TABLE lightw.test (
|
|
||||||
k int PRIMARY KEY,
|
|
||||||
v int )'''
|
|
||||||
session.execute(ddl)
|
|
||||||
|
|
||||||
except Exception:
|
except Exception:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
raise
|
raise
|
||||||
|
|||||||
@@ -373,11 +373,18 @@ class LightweightTransactionsTests(unittest.TestCase):
|
|||||||
self.cluster = Cluster(protocol_version=PROTOCOL_VERSION)
|
self.cluster = Cluster(protocol_version=PROTOCOL_VERSION)
|
||||||
self.session = self.cluster.connect()
|
self.session = self.cluster.connect()
|
||||||
|
|
||||||
|
ddl = '''
|
||||||
|
CREATE TABLE test3rf.lwt (
|
||||||
|
k int PRIMARY KEY,
|
||||||
|
v int )'''
|
||||||
|
self.session.execute(ddl)
|
||||||
|
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
"""
|
"""
|
||||||
Shutdown cluster
|
Shutdown cluster
|
||||||
"""
|
"""
|
||||||
|
self.session.execute("DROP TABLE test3rf.lwt")
|
||||||
self.cluster.shutdown()
|
self.cluster.shutdown()
|
||||||
|
|
||||||
|
|
||||||
@@ -389,8 +396,8 @@ class LightweightTransactionsTests(unittest.TestCase):
|
|||||||
Default value is 1000
|
Default value is 1000
|
||||||
"""
|
"""
|
||||||
ok = True
|
ok = True
|
||||||
insert_statement = self.session.prepare("INSERT INTO lightw.test (k, v) VALUES (0, 0) IF NOT EXISTS")
|
insert_statement = self.session.prepare("INSERT INTO test3rf.lwt (k, v) VALUES (0, 0) IF NOT EXISTS")
|
||||||
delete_statement = self.session.prepare("DELETE FROM lightw.test WHERE k = 0 IF EXISTS")
|
delete_statement = self.session.prepare("DELETE FROM test3rf.lwt WHERE k = 0 IF EXISTS")
|
||||||
|
|
||||||
iterations = int(os.getenv("LWT_ITERATIONS", 1000))
|
iterations = int(os.getenv("LWT_ITERATIONS", 1000))
|
||||||
print("Started test for %d iterations" % iterations)
|
print("Started test for %d iterations" % iterations)
|
||||||
|
|||||||
Reference in New Issue
Block a user