You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "OrDTesters (GitHub)" <gi...@apache.org> on 2018/11/21 05:45:06 UTC

[GitHub] [incubator-dubbo] OrDTesters commented on issue #2807: Fixing test-order dependency in org.apache.dubbo.rpc.cluster.StickyTest

The two tests have to be run in the same JVM. The order of the tests written in the file does not control the order that they are actually run by JUnit. To reproduce this issue, there is a way to force JUnit to run the tests in a specific order.

Add the annotation @org.junit.FixMethodOrder(org.junit.runners.MethodSorters.NAME_ASCENDING) to the test class. This will force JUnit to run the tests in the ascending alphabetical order of their names, so testStickyForceCheck will run before testStickyNoCheck.

Since without FixMethodOrder the order of the tests is not guaranteed, it is best to make sure the tests can pass when they are run in any order.

[ Full content available at: https://github.com/apache/incubator-dubbo/pull/2807 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org