cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xe...@apache.org
Subject [2/2] git commit: fix system tests patch by Pavel Yaskevich; reviewed by Brandon Williams for CASSANDRA-3827
Date Tue, 07 Feb 2012 15:33:41 GMT
fix system tests
patch by Pavel Yaskevich; reviewed by Brandon Williams for CASSANDRA-3827


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

Branch: refs/heads/trunk
Commit: 651bf357550c15eddedd762758667443166f3e54
Parents: e04e769
Author: Pavel Yaskevich <xedin@apache.org>
Authored: Tue Feb 7 18:30:43 2012 +0300
Committer: Pavel Yaskevich <xedin@apache.org>
Committed: Tue Feb 7 18:30:43 2012 +0300

----------------------------------------------------------------------
 CHANGES.txt                       |    1 +
 test/system/__init__.py           |    2 +-
 test/system/test_thrift_server.py |   40 ++++++++++++++-----------------
 3 files changed, 20 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/651bf357/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 9ade510..f70e891 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -64,6 +64,7 @@
    (CASSANDRA-3483)
  * respect not only row cache capacity but caching mode when
    trying to read data (CASSANDRA-3812)
+ * fix system tests (CASSANDRA-3827)
 
 
 1.0.8

http://git-wip-us.apache.org/repos/asf/cassandra/blob/651bf357/test/system/__init__.py
----------------------------------------------------------------------
diff --git a/test/system/__init__.py b/test/system/__init__.py
index 4403851..d9b88ee 100644
--- a/test/system/__init__.py
+++ b/test/system/__init__.py
@@ -155,7 +155,7 @@ class ThriftTester(BaseTester):
             Cassandra.CfDef('Keyspace1', 'StandardLong1', comparator_type='LongType'), 
             Cassandra.CfDef('Keyspace1', 'StandardLong2', comparator_type='LongType'), 
             Cassandra.CfDef('Keyspace1', 'StandardInteger1', comparator_type='IntegerType'),
-            Cassandra.CfDef('Keyspace1', 'Super1', column_type='Super', subcomparator_type='LongType',
row_cache_size=1000, key_cache_size=0), 
+            Cassandra.CfDef('Keyspace1', 'Super1', column_type='Super', subcomparator_type='LongType'),
             Cassandra.CfDef('Keyspace1', 'Super2', column_type='Super', subcomparator_type='LongType'),

             Cassandra.CfDef('Keyspace1', 'Super3', column_type='Super', subcomparator_type='LongType'),

             Cassandra.CfDef('Keyspace1', 'Super4', column_type='Super', subcomparator_type='UTF8Type'),

http://git-wip-us.apache.org/repos/asf/cassandra/blob/651bf357/test/system/test_thrift_server.py
----------------------------------------------------------------------
diff --git a/test/system/test_thrift_server.py b/test/system/test_thrift_server.py
index fdc8736..f8d3e2a 100644
--- a/test/system/test_thrift_server.py
+++ b/test/system/test_thrift_server.py
@@ -1399,13 +1399,11 @@ class TestMutations(ThriftTester):
         
         # modify valid
         modified_cf.comparator_type = 'BytesType' # revert back to old value.
-        modified_cf.row_cache_size = 25
         modified_cf.gc_grace_seconds = 1
         client.system_update_column_family(modified_cf)
         ks1 = client.describe_keyspace('Keyspace1')
         server_cf = [x for x in ks1.cf_defs if x.name=='NewColumnFamily'][0]
         assert server_cf
-        assert server_cf.row_cache_size == 25
         assert server_cf.gc_grace_seconds == 1
         
         # drop
@@ -1487,8 +1485,8 @@ class TestMutations(ThriftTester):
         # First without index
         cp = ColumnParent('ToBeIndexed')
         sp = SlicePredicate(slice_range=SliceRange('', ''))
-        clause = FilterClause([IndexExpression('birthdate', IndexOperator.EQ, _i64(1))])
-        result = get_range_slice(client, cp, sp, '', '', 100, ConsistencyLevel.ONE, clause)
+        key_range = KeyRange('', '', None, None, [IndexExpression('birthdate', IndexOperator.EQ,
_i64(1))], 100)
+        result = client.get_range_slices(cp, sp, key_range, ConsistencyLevel.ONE)
         assert len(result) == 1, result
         assert result[0].key == 'key1'
         assert len(result[0].columns) == 1, result[0].columns
@@ -1511,7 +1509,7 @@ class TestMutations(ThriftTester):
         time.sleep(0.5)
         
         # repeat query on one index expression
-        result = get_range_slice(client, cp, sp, '', '', 100, ConsistencyLevel.ONE, clause)
+        result = client.get_range_slices(cp, sp, key_range, ConsistencyLevel.ONE)
         assert len(result) == 1, result
         assert result[0].key == 'key1'
         assert len(result[0].columns) == 1, result[0].columns
@@ -1857,21 +1855,20 @@ class TestMutations(ThriftTester):
         # simple query on one index expression
         cp = ColumnParent('Indexed1')
         sp = SlicePredicate(slice_range=SliceRange('', ''))
-        clause = FilterClause([IndexExpression('birthdate', IndexOperator.EQ, _i64(1))])
-        result = get_range_slice(client, cp, sp, '', '', 100, ConsistencyLevel.ONE, clause)
+        key_range = KeyRange('', '', None, None, [IndexExpression('birthdate', IndexOperator.EQ,
_i64(1))], 100)
+        result = client.get_range_slices(cp, sp, key_range, ConsistencyLevel.ONE)
         assert len(result) == 1, result
         assert result[0].key == 'key1'
         assert len(result[0].columns) == 1, result[0].columns
 
         # without index
-        clause = FilterClause([IndexExpression('b', IndexOperator.EQ, _i64(1))])
-        result = get_range_slice(client, cp, sp, '', '', 100, ConsistencyLevel.ONE, clause)
+        key_range = KeyRange('', '', None, None, [IndexExpression('b', IndexOperator.EQ,
_i64(1))], 100)
+        result = client.get_range_slices(cp, sp, key_range, ConsistencyLevel.ONE)
         assert len(result) == 0, result
 
         # but unindexed expression added to indexed one is ok
-        clause = FilterClause([IndexExpression('b', IndexOperator.EQ, _i64(3)),
-                               IndexExpression('birthdate', IndexOperator.EQ, _i64(3))])
-        result = get_range_slice(client, cp, sp, '', '', 100, ConsistencyLevel.ONE, clause)
+        key_range = KeyRange('', '', None, None, [IndexExpression('b', IndexOperator.EQ,
_i64(3)), IndexExpression('birthdate', IndexOperator.EQ, _i64(3))], 100)
+        result = client.get_range_slices(cp, sp, key_range, ConsistencyLevel.ONE)
         assert len(result) == 1, result
         assert result[0].key == 'key3'
         assert len(result[0].columns) == 2, result[0].columns
@@ -1885,20 +1882,19 @@ class TestMutations(ThriftTester):
         client.insert('key1', ColumnParent('Indexed3'), Column(u, 'a', 0), ConsistencyLevel.ONE)
         client.insert('key1', ColumnParent('Indexed3'), Column(u2, 'b', 0), ConsistencyLevel.ONE)
         # name comparator + data validator of incompatible types -- see CASSANDRA-2347
-        clause = FilterClause([IndexExpression(u, IndexOperator.EQ, 'a'),
-                              IndexExpression(u2, IndexOperator.EQ, 'b')])
-        result = get_range_slice(client, cp, sp, '', '', 100, ConsistencyLevel.ONE, clause)
+        key_range = KeyRange('', '', None, None, [IndexExpression(u, IndexOperator.EQ, 'a'),
IndexExpression(u2, IndexOperator.EQ, 'b')], 100)
+        result = client.get_range_slices(cp, sp, key_range, ConsistencyLevel.ONE)
         assert len(result) == 1, result
 
         cp = ColumnParent('Indexed2') # timeuuid name, long values
 
         # name must be valid (TimeUUID)
-        clause = FilterClause([IndexExpression('foo', IndexOperator.EQ, uuid.UUID('00000000-0000-1000-0000-000000000000').bytes)])
-        _expect_exception(lambda: get_range_slice(client, cp, sp, '', '', 100, ConsistencyLevel.ONE,
clause), InvalidRequestException)
+        key_range = KeyRange('', '', None, None, [IndexExpression('foo', IndexOperator.EQ,
uuid.UUID('00000000-0000-1000-0000-000000000000').bytes)], 100)
+        _expect_exception(lambda: client.get_range_slices(cp, sp, key_range, ConsistencyLevel.ONE),
InvalidRequestException)
         
         # value must be valid (TimeUUID)
-        clause = FilterClause([IndexExpression(uuid.UUID('00000000-0000-1000-0000-000000000000').bytes,
IndexOperator.EQ, "foo")])
-        _expect_exception(lambda: get_range_slice(client, cp, sp, '', '', 100, ConsistencyLevel.ONE,
clause), InvalidRequestException)
+        key_range = KeyRange('', '', None, None, [IndexExpression(uuid.UUID('00000000-0000-1000-0000-000000000000').bytes,
IndexOperator.EQ, "foo")], 100)
+        _expect_exception(lambda: client.get_range_slices(cp, sp, key_range, ConsistencyLevel.ONE),
InvalidRequestException)
         
     def test_index_scan_expiring(self):
         """ Test that column ttled expires from KEYS index"""
@@ -1906,13 +1902,13 @@ class TestMutations(ThriftTester):
         client.insert('key1', ColumnParent('Indexed1'), Column('birthdate', _i64(1), 0, 1),
ConsistencyLevel.ONE)
         cp = ColumnParent('Indexed1')
         sp = SlicePredicate(slice_range=SliceRange('', ''))
-        clause = FilterClause([IndexExpression('birthdate', IndexOperator.EQ, _i64(1))])
+        key_range = KeyRange('', '', None, None, [IndexExpression('birthdate', IndexOperator.EQ,
_i64(1))], 100)
         # query before expiration
-        result = get_range_slice(client, cp, sp, '', '', 100, ConsistencyLevel.ONE, clause)
+        result = client.get_range_slices(cp, sp, key_range, ConsistencyLevel.ONE)
         assert len(result) == 1, result
         # wait for expiration and requery
         time.sleep(2)
-        result = get_range_slice(client, cp, sp, '', '', 100, ConsistencyLevel.ONE, clause)
+        result = client.get_range_slices(cp, sp, key_range, ConsistencyLevel.ONE)
         assert len(result) == 0, result
      
     def test_column_not_found_quorum(self): 


Mime
View raw message