Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion integration/indexes/indexes_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def test_can_create_index_on_partial_collections
assert_equal 'keys(b)', index.target

@session.execute("DROP INDEX b_index")
@cluster.refresh_schema
@session.execute("CREATE INDEX b_index ON simplex.collection_test (b)")

@listener.wait_for_index('simplex', 'collection_test', 'b_index')
Expand Down Expand Up @@ -118,7 +119,7 @@ def test_can_create_index_on_partial_collections
# @test_category indexes
#
def test_can_create_index_on_full_collections
skip("Secondary index on full collections were introduced in Cassandra 2.1.3") if CCM.cassandra_version.to_i < '2.1.3'.to_i
skip("Secondary index on full collections were introduced in Cassandra 2.1.3") if Gem::Version.new(CCM.cassandra_version) < Gem::Version.new('2.1.3')

@session.execute("CREATE TABLE simplex.collection_test (a int PRIMARY KEY, b frozen<map<text, text>>)")
@session.execute("CREATE INDEX b_index ON simplex.collection_test (full(b))")
Expand Down
5 changes: 3 additions & 2 deletions integration/indexes/materialized_view_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def test_materialized_view_metadata_updates
assert_equal 'SizeTieredCompactionStrategy', mv_meta.options.compaction_strategy.class_name

@session.execute("ALTER MATERIALIZED VIEW simplex.mv1 WITH compaction = { 'class' : 'LeveledCompactionStrategy' }")
sleep(2)
@cluster.refresh_schema
mv_meta = @cluster.keyspace('simplex').materialized_view('mv1')
assert_equal 'LeveledCompactionStrategy', mv_meta.options.compaction_strategy.class_name
end
Expand All @@ -234,7 +234,7 @@ def test_materialized_view_metadata_drop
assert @cluster.keyspace('simplex').has_materialized_view?('mv1')

@session.execute("DROP MATERIALIZED VIEW simplex.mv1")
sleep(2)
@cluster.refresh_schema
refute @cluster.keyspace('simplex').has_materialized_view?('mv1')
end

Expand Down Expand Up @@ -276,6 +276,7 @@ def test_base_table_column_addition
refute mv_meta.has_column?('fouls')

@session.execute("ALTER TABLE simplex.scores2 ADD fouls INT")
@cluster.refresh_schema

table_meta = @cluster.keyspace('simplex').table('scores2')
assert table_meta.has_column?('fouls')
Expand Down
4 changes: 3 additions & 1 deletion integration/schema_change_listener.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def wait_for_table(keyspace_name, table_name, *args)
end

def wait_for_index(keyspace_name, table_name, index_name, *args)
self.wait_for_table(keyspace_name, table_name)
wait_for_change(keyspace_name, 2) do |ks|
ks.table(table_name).has_index?(index_name, *args)
end
Expand All @@ -79,4 +80,5 @@ def keyspace_changed(keyspace)
@conditions.fetch(keyspace.name) { return }.each { |c| c.evaluate(keyspace) }
nil
end
end
end