You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Caleb Rackliffe (Jira)" <ji...@apache.org> on 2021/09/13 21:58:00 UTC

[jira] [Comment Edited] (CASSANDRA-16942) Remove OrderedJUnit4ClassRunner

    [ https://issues.apache.org/jira/browse/CASSANDRA-16942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17414603#comment-17414603 ] 

Caleb Rackliffe edited comment on CASSANDRA-16942 at 9/13/21, 9:57 PM:
-----------------------------------------------------------------------

Finished a pass at review. There are some nits (we're cleaning up, so why not), which you can take or leave as you please, and some interesting results from running the tests locally, which I'll describe here first (and then investigate a bit if I have time today).

*Nits*

_Unused Imports_
 - {{import static org.junit.Assert.assertNotEquals}} in {{CompactionsTest}}

 - {{import java.util.ArrayList}} in {{ScrubTest}}

 - {{import org.junit.runner.RunWith}} and {{import org.junit.runners.Parameterized}} in {{QueryPagerTest}}

 - {{import static org.junit.Assert.fail}} in {{BulkLoaderTest}}

_Miscellaneous_
 - {{TestEventType}} has an unnecessary semicolon in

 - {{testBulkLoader_NoArgs}} doesn't need the {{throws Exception}} in {{DiagnosticEventServiceTest}}

 - {{testFromatArg()}} doesn't need the {{throws Throwable}} in {{NodeToolTPStatsTest}}

 - Should we do the second {{setPartitionerUnsafe()}} in a {{finally}} block in {{ScrubTest#testFilterOutDuplicates}}?

*Failures*

(Note that these are failures I encountered when running from IDEA.)
 - {{testCleanupArg}}, {{testTypeArg}}, {{testDefaultCall}}, and {{testListFilesArgs}} fail in {{StandaloneSSTableUtilTest}}, in that order.

 - {{testFlagArgs}} and {{testDefaultCall}} fail in that order in {{StandaloneUpgraderTest}}

 - All but two tests fail in {{StandaloneVerifierTest}}.

ex.
{noformat}
ERROR [main] 2021-09-13 14:41:35,043 SSTableReader.java:487 - Cannot open /Users/maedhroz/Projects/Apache/github-cassandra/build/test/cassandra/data/system_schema/tables-afddfb9dbc1e30688056eed6c302ba09/nb-37-big; partitioner org.apache.cassandra.dht.ByteOrderedPartitioner does not match system partitioner org.apache.cassandra.dht.Murmur3Partitioner.  Note that the default partitioner starting with Cassandra 1.2 is Murmur3Partitioner, so you will need to edit that to match your old partitioner if upgrading.

java.lang.AssertionError: [org.apache.cassandra.tools.StandaloneVerifier,
    --debug,
    system_schema,
    tables]
exited with code 1
stderr:
stdout:
sstableverify using the following options: Options{keyspaceName='system_schema', cfName='tables', debug=true, verbose=false, extended=false, checkVersion=false, mutateRepairStatus=false, quick=false, tokens=[]}
	at org.junit.Assert.fail(Assert.java:88)
	at org.apache.cassandra.tools.ToolRunner$ToolResult.assertExitCode(ToolRunner.java:408)
	at org.apache.cassandra.tools.ToolRunner$ToolResult.assertOnExitCode(ToolRunner.java:402)
	at org.apache.cassandra.tools.StandaloneVerifierTest.testDebugArg(StandaloneVerifierTest.java:81)
{noformat}


was (Author: maedhroz):
Finished a pass at review. There are some nits (we're cleaning up, so why not), which you can take or leave as you please, and some interesting results from running the tests locally, which I'll describe here first (and then investigate a bit if I have time today).

*Nits*

_Unused Imports_

- {{import static org.junit.Assert.assertNotEquals}} in {{CompactionsTest}}

- {{import java.util.ArrayList}} in {{ScrubTest}}

- {{import org.junit.runner.RunWith}} and {{import org.junit.runners.Parameterized}} in {{QueryPagerTest}}

- {{import static org.junit.Assert.fail}} in {{BulkLoaderTest}}

_Miscellaneous_

- {{TestEventType}} has an unnecessary semicolon in 

- {{testBulkLoader_NoArgs}} doesn't need the {{throws Exception}} in {{DiagnosticEventServiceTest}}

- {{testFromatArg()}} doesn't need the {{throws Throwable}} in {{NodeToolTPStatsTest}}

- Should we do the second {{setPartitionerUnsafe()}} in a {{finally}} block in {{ScrubTest#testFilterOutDuplicates}}?

*Failures*

(Note that these are failures I encountered when running from IDEA.)

- {{testDefaultCall}} seems to fail when it runs second (after {{testNoArgsPrintsHelp}}) in {{SSTableExpiredBlockersTest}}, {{SSTableLevelResetterTest}}, and {{SSTableOfflineRelevelTest}}.

{noformat}
java.lang.AssertionError: 
Expected: a string containing "No sstables for" ignoring case
     but: was ""
Expected :a string containing "No sstables for" ignoring case
Actual   :""
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
	at org.junit.Assert.assertThat(Assert.java:956)
	at org.junit.Assert.assertThat(Assert.java:923)
	at org.apache.cassandra.tools.SSTableExpiredBlockersTest.testDefaultCall(SSTableExpiredBlockersTest.java:71)
{noformat}

- {{testCleanupArg}}, {{testTypeArg}}, {{testDefaultCall}}, and {{testListFilesArgs}} fail in {{StandaloneSSTableUtilTest}}, in that order.

- {{testFlagArgs}} and {{testDefaultCall}} fail in that order in {{StandaloneUpgraderTest}}

- All but two tests fail in {{StandaloneVerifierTest}}.

ex.

{noformat}
ERROR [main] 2021-09-13 14:41:35,043 SSTableReader.java:487 - Cannot open /Users/maedhroz/Projects/Apache/github-cassandra/build/test/cassandra/data/system_schema/tables-afddfb9dbc1e30688056eed6c302ba09/nb-37-big; partitioner org.apache.cassandra.dht.ByteOrderedPartitioner does not match system partitioner org.apache.cassandra.dht.Murmur3Partitioner.  Note that the default partitioner starting with Cassandra 1.2 is Murmur3Partitioner, so you will need to edit that to match your old partitioner if upgrading.

java.lang.AssertionError: [org.apache.cassandra.tools.StandaloneVerifier,
    --debug,
    system_schema,
    tables]
exited with code 1
stderr:
stdout:
sstableverify using the following options: Options{keyspaceName='system_schema', cfName='tables', debug=true, verbose=false, extended=false, checkVersion=false, mutateRepairStatus=false, quick=false, tokens=[]}
	at org.junit.Assert.fail(Assert.java:88)
	at org.apache.cassandra.tools.ToolRunner$ToolResult.assertExitCode(ToolRunner.java:408)
	at org.apache.cassandra.tools.ToolRunner$ToolResult.assertOnExitCode(ToolRunner.java:402)
	at org.apache.cassandra.tools.StandaloneVerifierTest.testDebugArg(StandaloneVerifierTest.java:81)
{noformat}


> Remove OrderedJUnit4ClassRunner
> -------------------------------
>
>                 Key: CASSANDRA-16942
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-16942
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Test/unit
>            Reporter: Marcus Eriksson
>            Assignee: Marcus Eriksson
>            Priority: Normal
>             Fix For: 4.0.x, 4.x
>
>
> Tests in a class should not depend on the order they are run in, remove {{OrderedJUnit4ClassRunner}} and fix any tests that depend on it



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org