Skip to content

Test testParallelSlowLog() fails when run independently #192

@aditya-kumbhar

Description

@aditya-kumbhar

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions