Skip to content

Commit 4030c27

Browse files
authored
CNDB-14291: Fix flaky SingleNodeQueryFailureTest (#1784)
The tests in SingleNodeQueryFailureTest suite inject failures into the code paths executed by a test query that uses two indexes. This commit disables the query optimizer because it was interfering by removing an index from the plan so sometimes the path with the injected failure was not taken. Fixes riptano/cndb#14291
1 parent fef8871 commit 4030c27

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/unit/org/apache/cassandra/index/sai/disk/SingleNodeQueryFailureTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.apache.cassandra.index.sai.disk.v1.KeyFetcher;
2929
import org.apache.cassandra.index.sai.disk.v1.TermsReader;
3030
import org.apache.cassandra.index.sai.disk.v1.postings.PostingsReader;
31+
import org.apache.cassandra.index.sai.plan.QueryController;
3132
import org.apache.cassandra.inject.Injection;
3233
import org.apache.cassandra.inject.Injections;
3334
import org.apache.cassandra.utils.Throwables;
@@ -46,6 +47,10 @@ public class SingleNodeQueryFailureTest extends SAITester
4647
public void setup() throws Throwable
4748
{
4849
requireNetwork();
50+
51+
// Disable query optimization for this test so all indexes are queried,
52+
// and we can inject failures into any of them.
53+
QueryController.QUERY_OPT_LEVEL = 0;
4954
}
5055

5156
@After

0 commit comments

Comments
 (0)