[
https://issues.apache.org/jira/browse/CASSANDRA-15528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17053092#comment-17053092
]
Gianluca Righetto commented on CASSANDRA-15528:
-----------------------------------------------
I'm able to reproduce this by inducing a failure on line 1108 of
o.a.c.i.s.SASIIndexTest.java
[https://github.com/apache/cassandra/blob/3f2a248da11448ed9fd38467e4b353ed4df4888f/test/unit/org/apache/cassandra/index/sasi/SASIIndexTest.java#L1108]
What is happening here is that when an exception or assertion error is thrown
at that point, JUnit moves on to the next test, but the ExecutorService (on
line 1084) continues to process the insertions in the background (even after
the keyspace is truncated in the @Before/cleanup step), which pollutes the
results of this test.
CASSANDRA-15526 made this more apparent, but the fix for that doesn't
necessarily fix this one. The proper fix here is to shutdown (and wait for) the
ExecutorService before running another test method.
I'm submitting a patch that adds a try/finally block and shuts down the
insertion threads.
> Fix flakey test - org.apache.cassandra.index.sasi.SASIIndexTest testInvalidate
> ------------------------------------------------------------------------------
>
> Key: CASSANDRA-15528
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15528
> Project: Cassandra
> Issue Type: Bug
> Components: Test/unit
> Reporter: David Capwell
> Assignee: Gianluca Righetto
> Priority: Normal
> Fix For: 4.0-alpha
>
>
> {code}
> junit.framework.AssertionFailedError: [key0, key2918, key2919, key2920,
> key2921, key2922, key2924, key2926, key2927, key2928]
> at
> org.apache.cassandra.index.sasi.SASIIndexTest.testInvalidate(SASIIndexTest.java:874)
> at
> org.apache.cassandra.index.sasi.SASIIndexTest.testInvalidate(SASIIndexTest.java:852)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]