You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by al...@apache.org on 2013/05/05 22:45:48 UTC

git commit: Ninja-fix system tests

Updated Branches:
  refs/heads/trunk 0f4ce2fb6 -> b04f03dfa


Ninja-fix system tests


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/b04f03df
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b04f03df
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b04f03df

Branch: refs/heads/trunk
Commit: b04f03dfae1a138825e4efb093d5c67565a53f58
Parents: 0f4ce2f
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Sun May 5 23:45:20 2013 +0300
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Sun May 5 23:45:20 2013 +0300

----------------------------------------------------------------------
 test/system/__init__.py           |    4 ++--
 test/system/test_thrift_server.py |   16 +++++++---------
 2 files changed, 9 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b04f03df/test/system/__init__.py
----------------------------------------------------------------------
diff --git a/test/system/__init__.py b/test/system/__init__.py
index 183c399..669bf6d 100644
--- a/test/system/__init__.py
+++ b/test/system/__init__.py
@@ -72,7 +72,7 @@ class BaseTester(object):
             # todo get directories from conf/cassandra.yaml
             for dirname in ['system', 'data', 'commitlog']:
                 try:
-                    shutil.rmtree('build/test/cassandra/' + dirname)
+                    shutil.rmtree(os.path.join(root, 'build', 'test', 'cassandra', dirname))
                 except OSError:
                     pass
             # start the server
@@ -133,7 +133,7 @@ class BaseTester(object):
                     break
                 slept += 0.5
             # Give time for cassandra to shutdown
-            time.sleep(1)
+            time.sleep(2)
             if (slept > max_wait and is_alive(spid)):
                 os.kill(spid, signal.SIGKILL)
                 fpath = os.path.join(root, pid_fname)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b04f03df/test/system/test_thrift_server.py
----------------------------------------------------------------------
diff --git a/test/system/test_thrift_server.py b/test/system/test_thrift_server.py
index 151ca48..7e23296 100644
--- a/test/system/test_thrift_server.py
+++ b/test/system/test_thrift_server.py
@@ -979,8 +979,7 @@ class TestMutations(ThriftTester):
             client.insert(key, ColumnParent('Standard1'), Column(key, 'v', 0), ConsistencyLevel.ONE)
 
         slices = get_range_slice(client, ColumnParent('Standard1'), SlicePredicate(column_names=['-a', '-a']), '', '', 1000, ConsistencyLevel.ONE)
-        # note the collated ordering rather than ascii
-        L = ['0', '1', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '2', '20', '21', '22', '23', '24', '25', '26', '27','28', '29', '3', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '4', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '5', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '6', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '7', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '8', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '9', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', 'a', '-a', 'b', '-b']
+        L = ['-a', '-b', '0', '1', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '2', '20', '21', '22', '23', '24', '25', '26', '27','28', '29', '3', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '4', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '5', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '6', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '7', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '8', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '9', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', 'a', 'b']
         assert len(slices) == len(L)
         for key, ks in zip(L, slices):
             assert key == ks.key
@@ -997,10 +996,10 @@ class TestMutations(ThriftTester):
                 assert key == ks.key
         
         slices = get_range_slice(client, ColumnParent('Standard1'), SlicePredicate(column_names=['-a', '-a']), 'a', '', 1000, ConsistencyLevel.ONE)
-        check_slices_against_keys(['a', '-a', 'b', '-b'], slices)
+        check_slices_against_keys(['a', 'b'], slices)
         
         slices = get_range_slice(client, ColumnParent('Standard1'), SlicePredicate(column_names=['-a', '-a']), '', '15', 1000, ConsistencyLevel.ONE)
-        check_slices_against_keys(['0', '1', '10', '11', '12', '13', '14', '15'], slices)
+        check_slices_against_keys(['-a', '-b', '0', '1', '10', '11', '12', '13', '14', '15'], slices)
 
         slices = get_range_slice(client, ColumnParent('Standard1'), SlicePredicate(column_names=['-a', '-a']), '50', '51', 1000, ConsistencyLevel.ONE)
         check_slices_against_keys(['50', '51'], slices)
@@ -1125,7 +1124,7 @@ class TestMutations(ThriftTester):
         assert [row.key for row in result] == ['a', 'b', 'c', 'd', 'e',], [row.key for row in result]
 
         result = client.get_range_slices(cp, SlicePredicate(column_names=['col1', 'col3']), KeyRange(start_token=copp_token('c'), end_token=copp_token('c')), ConsistencyLevel.ONE)
-        assert [row.key for row in result] == ['d', 'e', 'a', 'b', 'c',], [row.key for row in result]
+        assert [row.key for row in result] == ['a', 'b', 'c', 'd', 'e',], [row.key for row in result]
         
 
     def test_get_slice_by_names(self):
@@ -1209,7 +1208,7 @@ class TestMutations(ThriftTester):
 
     def test_describe_keyspace(self):
         kspaces = client.describe_keyspaces()
-        assert len(kspaces) == 3, kspaces # ['Keyspace2', 'Keyspace1', 'system']
+        assert len(kspaces) == 5, kspaces # ['Keyspace2', 'Keyspace1', 'system', 'system_traces', 'system_auth']
 
         sysks = client.describe_keyspace("system")
         assert sysks in kspaces
@@ -1231,7 +1230,7 @@ class TestMutations(ThriftTester):
         assert list(client.describe_ring('Keyspace1'))[0].endpoints == ['127.0.0.1']
 
     def test_describe_token_map(self):
-        # test/conf/cassandra.yaml specifies org.apache.cassandra.dht.CollatingOrderPreservingPartitioner
+        # test/conf/cassandra.yaml specifies org.apache.cassandra.dht.ByteOrderedPartitioner
         # which uses BytesToken, so this just tests that the string representation of the token	
         # matches a regex pattern for BytesToken.toString().
         ring = client.describe_token_map().items()
@@ -1242,7 +1241,7 @@ class TestMutations(ThriftTester):
 
     def test_describe_partitioner(self):
         # Make sure this just reads back the values from the config.
-        assert client.describe_partitioner() == "org.apache.cassandra.dht.CollatingOrderPreservingPartitioner"
+        assert client.describe_partitioner() == "org.apache.cassandra.dht.ByteOrderedPartitioner"
 
     def test_describe_snitch(self):
         assert client.describe_snitch() == "org.apache.cassandra.locator.SimpleSnitch"
@@ -1412,7 +1411,6 @@ class TestMutations(ThriftTester):
         ks1 = client.describe_keyspace('Keyspace1')
         assert 'NewColumnFamily' in [x.name for x in ks1.cf_defs]
         cfid = [x.id for x in ks1.cf_defs if x.name=='NewColumnFamily'][0]
-        assert cfid > 1000
         
         # modify invalid
         modified_cf = CfDef('Keyspace1', 'NewColumnFamily', column_metadata=[cd])