Permalink
Browse files

Bump test timeout

Several people have hit this now
  • Loading branch information...
natemueller committed Sep 26, 2012
1 parent 4777086 commit 9e5966728e2c8e894efb60acd0383ecb2c338ce4
Showing with 11 additions and 11 deletions.
  1. +11 −11 test/cassandra_test.rb
View
@@ -8,16 +8,16 @@ def assert_has_keys(keys, hash)
end
def setup
- @twitter = Cassandra.new('Twitter', "127.0.0.1:9160", :retries => 2, :connect_timeout => 0.1, :timeout => 5, :exception_classes => [])
+ @twitter = Cassandra.new('Twitter', "127.0.0.1:9160", :retries => 2, :connect_timeout => 1, :timeout => 5, :exception_classes => [])
@twitter.clear_keyspace!
- @blogs = Cassandra.new('Multiblog', "127.0.0.1:9160", :retries => 2, :connect_timeout => 0.1, :timeout => 5, :exception_classes => [])
+ @blogs = Cassandra.new('Multiblog', "127.0.0.1:9160", :retries => 2, :connect_timeout => 1, :timeout => 5, :exception_classes => [])
@blogs.clear_keyspace!
- @blogs_long = Cassandra.new('MultiblogLong', "127.0.0.1:9160", :retries => 2, :connect_timeout => 0.1, :timeout => 5, :exception_classes => [])
+ @blogs_long = Cassandra.new('MultiblogLong', "127.0.0.1:9160", :retries => 2, :connect_timeout => 1, :timeout => 5, :exception_classes => [])
@blogs_long.clear_keyspace!
- @type_conversions = Cassandra.new('TypeConversions', "127.0.0.1:9160", :retries => 2, :connect_timeout => 0.1, :timeout => 5, :exception_classes => [])
+ @type_conversions = Cassandra.new('TypeConversions', "127.0.0.1:9160", :retries => 2, :connect_timeout => 1, :timeout => 5, :exception_classes => [])
@type_conversions.clear_keyspace!
Cassandra::WRITE_DEFAULTS[:consistency] = Cassandra::Consistency::ONE
@@ -641,12 +641,12 @@ def test_batch_queue_size
assert_equal({}, @twitter.get(:UserCounters, 'bob')) if CASSANDRA_VERSION.to_f >= 0.8 # Written
if CASSANDRA_VERSION.to_f >= 0.8
- @twitter.add(:UserCounters, 'bob', 5, 'tweet_count')
+ @twitter.add(:UserCounters, 'bob', 5, 'tweet_count')
else
@twitter.insert(:Users, k + '2', {'body' => 'v2', 'user' => 'v2'})
end
# Flush!
-
+
assert_equal({'body' => 'v2', 'user' => 'v2'}, @twitter.get(:Users, k + '2')) # Written
assert_equal({'body' => 'v3', 'user' => 'v3', 'location' => 'v3'}, @twitter.get(:Users, k + '3')) # Written and compacted
assert_equal({'body' => 'v'}, @twitter.get(:Statuses, k + '3')) # Written
@@ -660,27 +660,27 @@ def test_batch_queue_size
assert_equal({'body' => 'v1', 'user' => 'v1'}, @twitter.get(:Users, k + '1')) # Not yet removed
assert_equal({'delete_me' => 'v0', 'keep_me' => 'v0'}, @twitter.get(:Users, k + '0')) # Not yet removed
assert_equal({}, @twitter.get(:Users, k + '4')) # Not yet written
-
+
@twitter.insert(:Users, k + '5', {'body' => 'v5', 'user' => 'v5'})
# Flush!
-
+
assert_equal({'body' => 'v4', 'user' => 'v4'}, @twitter.get(:Users, k + '4')) # Written
assert_equal({}, @twitter.get(:Users, k + '1')) # Removed
assert_equal({ 'keep_me' => 'v0'}, @twitter.get(:Users, k + '0')) # 'delete_me' column removed
-
+
assert_equal({'body' => 'v2', 'user' => 'v2'}.keys.sort, @twitter.get(:Users, k + '2').timestamps.keys.sort) # Written
assert_equal({'body' => 'v3', 'user' => 'v3', 'location' => 'v3'}.keys.sort, @twitter.get(:Users, k + '3').timestamps.keys.sort) # Written and compacted
assert_equal({'body' => 'v4', 'user' => 'v4'}.keys.sort, @twitter.get(:Users, k + '4').timestamps.keys.sort) # Written
assert_equal({'body' => 'v'}.keys.sort, @twitter.get(:Statuses, k + '3').timestamps.keys.sort) # Written
-
+
# SuperColumns
# Add and delete new sub columns to the user timeline supercolumn
@twitter.insert(:StatusRelationships, k, {'user_timelines' => new_subcolumns })
@twitter.remove(:StatusRelationships, k, 'user_timelines' , subcolumn_to_delete ) # Delete the first of the initial_subcolumns from the user_timeline supercolumn
# Delete a complete supercolumn
@twitter.remove(:StatusRelationships, k, 'dummy_supercolumn' ) # Delete the full dummy supercolumn
end
-
+
# Final result: initial_subcolumns - initial_subcolumns.first + new_subcolumns
resulting_subcolumns = initial_subcolumns.merge(new_subcolumns).reject{|k2,v| k2 == subcolumn_to_delete }
assert_equal(resulting_subcolumns, @twitter.get(:StatusRelationships, key, 'user_timelines'))

0 comments on commit 9e59667

Please sign in to comment.