Skip to content

Commit 172adfb

Browse files
authored
CNDB-14232 fix flakiness in BM25 by createIndex (#1769)
Few indexes were created with execute method, which doesn't check if an index is ready. Changing it to createIndex fixes the observed flakiness.
1 parent 133ac77 commit 172adfb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/unit/org/apache/cassandra/index/sai/cql/BM25Test.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ public void testWithPredicate() throws Throwable
464464
{
465465
createTable("CREATE TABLE %s (k int PRIMARY KEY, p int, v text)");
466466
createAnalyzedIndex();
467-
execute("CREATE CUSTOM INDEX ON %s(p) USING 'StorageAttachedIndex'");
467+
createIndex("CREATE CUSTOM INDEX ON %s(p) USING 'StorageAttachedIndex'");
468468

469469
// Insert documents with varying frequencies of the term "apple"
470470
execute("INSERT INTO %s (k, p, v) VALUES (1, 5, 'apple')");
@@ -535,7 +535,7 @@ public void testWidePartitionWithPredicate() throws Throwable
535535
{
536536
createTable("CREATE TABLE %s (k1 int, k2 int, p int, v text, PRIMARY KEY (k1, k2))");
537537
createAnalyzedIndex();
538-
execute("CREATE CUSTOM INDEX ON %s(p) USING 'StorageAttachedIndex'");
538+
createIndex("CREATE CUSTOM INDEX ON %s(p) USING 'StorageAttachedIndex'");
539539

540540
// Insert documents with varying frequencies of the term "apple"
541541
execute("INSERT INTO %s (k1, k2, p, v) VALUES (0, 1, 5, 'apple')");

0 commit comments

Comments
 (0)