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

Test testParallelSlowLog() fails when run independently #192

Open
aditya-kumbhar opened this issue Nov 30, 2022 · 0 comments · May be fixed by #193
Open

Test testParallelSlowLog() fails when run independently #192

aditya-kumbhar opened this issue Nov 30, 2022 · 0 comments · May be fixed by #193

Comments

@aditya-kumbhar
Copy link

aditya-kumbhar commented Nov 30, 2022

The test uk.co.flax.luwak.matchers.TestParallelMatcher.testParallelSlowLog() inside ConcurrentMatcherTestBase.java fails if run independently.

I used the following command to run the test using mvn:
mvn test -Dtest=uk.co.flax.luwak.matchers.TestParallelMatcher#testParallelSlowLog -DfailIfNoTests=false

Failure log:

testParallelSlowLog(uk.co.flax.luwak.matchers.TestParallelMatcher)  Time elapsed: 0.714 sec  <<< FAILURE!
java.lang.AssertionError: 
Expecting:
 <"Limit: 0
	1 [256454792ns]
	2 [2220334ns]
	3 [256454500ns]
">
not to contain:
 <"2 ["> 
	at uk.co.flax.luwak.matchers.ConcurrentMatcherTestBase.testParallelSlowLog(ConcurrentMatcherTestBase.java:118)

The assertion that fails is:

assertThat(matches.getSlowLog().toString())
                .contains("1 [")
                .contains("3 [")
                .doesNotContain("2 [");

The test passes when the following change is made, calling getSlowLog() directly without using the matches object:

assertThat(monitor.match(batch, factory).getSlowLog().toString())
                .contains("1 [")
                .contains("3 [")
                .doesNotContain("2 [");

The change is small and does not affect the test logic, I am raising this issue to discuss if I can raise a PR for the fix and to get some feedback on any alternative approach for making the test work on its own.

@aditya-kumbhar aditya-kumbhar linked a pull request Dec 1, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant