Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] org.opensearch.plugin.correlation.core.index.codec.correlation950.CorrelationCodecTests.testCorrelationVectorIndex is flaky #8329

Open
Xtansia opened this issue Jun 28, 2023 · 7 comments
Assignees
Labels
bug Something isn't working flaky-test Random test failure that succeeds on second run Other

Comments

@Xtansia
Copy link
Contributor

Xtansia commented Jun 28, 2023

See: https://build.ci.opensearch.org/job/gradle-check/18621/

REPRODUCE WITH: ./gradlew ':plugins:events-correlation-engine:test' --tests "org.opensearch.plugin.correlation.core.index.codec.correlation950.CorrelationCodecTests.testCorrelationVectorIndex" -Dtests.seed=5E5BD7BB82E4598E -Dtests.security.manager=true -Dtests.jvm.argline="-XX:TieredStopAtLevel=1 -XX:ReservedCodeCacheSize=64m" -Dtests.locale=hu-HU -Dtests.timezone=Asia/Katmandu -Druntime.java=20

Error:

org.mockito.exceptions.verification.TooManyActualInvocations: 
perFieldCorrelationVectorsFormat.getKnnVectorsFormatForField(
    "test_vector_one"
);
Wanted 1 time:
-> at org.opensearch.plugin.correlation.core.index.codec.correlation950.CorrelationCodecTests.testCorrelationVectorIndex(CorrelationCodecTests.java:108)
But was 2 times:
-> at org.apache.lucene.codecs.perfield.PerFieldKnnVectorsFormat$FieldsWriter.getInstance(PerFieldKnnVectorsFormat.java:133)
-> at org.apache.lucene.codecs.perfield.PerFieldKnnVectorsFormat$FieldsWriter.getInstance(PerFieldKnnVectorsFormat.java:133)


	at __randomizedtesting.SeedInfo.seed([5E5BD7BB82E4598E:151651F24B527EA2]:0)
	at app//org.opensearch.plugin.correlation.core.index.codec.correlation950.CorrelationCodecTests.testCorrelationVectorIndex(CorrelationCodecTests.java:108)
	at app//org.opensearch.plugin.correlation.core.index.codec.correlation950.CorrelationCodecTests.testCorrelationVectorIndex(CorrelationCodecTests.java:61)
	at java.base@20.0.1/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base@20.0.1/java.lang.reflect.Method.invoke(Method.java:578)
	at app//com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1750)
	at app//com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:938)
	at app//com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:974)
	at app//com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:988)
	at app//com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at app//org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at app//org.apache.lucene.tests.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:48)
	at app//org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
	at app//org.apache.lucene.tests.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:45)
	at app//org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
	at app//org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
	at app//org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at app//com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at app//com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:368)
	at app//com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:817)
	at app//com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:468)
	at app//com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:947)
	at app//com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:832)
	at app//com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:883)
	at app//com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:894)
	at app//org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
	at app//com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at app//org.apache.lucene.tests.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:38)
	at app//com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
	at app//com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
	at app//com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at app//com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at app//org.apache.lucene.tests.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
	at app//org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
	at app//org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
	at app//org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
	at app//org.apache.lucene.tests.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:47)
	at app//org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at app//com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at app//com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:368)
	at java.base@20.0.1/java.lang.Thread.run(Thread.java:1623)
@Xtansia Xtansia added bug Something isn't working untriaged flaky-test Random test failure that succeeds on second run labels Jun 28, 2023
@andrross
Copy link
Member

@sbcd90 FYI

@sbcd90
Copy link
Contributor

sbcd90 commented Jun 28, 2023

thanks @andrross . will look into it.

@sbcd90
Copy link
Contributor

sbcd90 commented Jun 29, 2023

hi @andrross ,
the flaky test happens when there is a random force merge.
Screenshot 2023-06-29 at 3 40 30 PM
there are 2 calls made when there is a random force merge.

will change

verify(perFieldCorrelationVectorsFormatSpy).getKnnVectorsFormatForField(eq(FIELD_NAME_ONE));

to

verify(perFieldCorrelationVectorsFormatSpy, atleastOnce()).getKnnVectorsFormatForField(eq(FIELD_NAME_ONE));

for fixing it.

@dblock
Copy link
Member

dblock commented Aug 10, 2023

#8986 (comment)

@dblock
Copy link
Member

dblock commented Aug 10, 2023

@sbcd90 are you fixing this?

@dblock
Copy link
Member

dblock commented Aug 10, 2023

Consider extracting if that PR takes a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flaky-test Random test failure that succeeds on second run Other
Projects
None yet
Development

No branches or pull requests

5 participants