Description
We've seen a few of these in Jenkins via the dev list https://lists.apache.org/list.html?dev@lucene.apache.org:lte=1y:%22duplicate%20clusterId%22 e.g.
FAILED: junit.framework.TestSuite.org.apache.solr.cloud.MultiSolrCloudTestCaseTest Error Message: duplicate clusterId cloud1 Stack Trace: java.lang.AssertionError: duplicate clusterId cloud1 at __randomizedtesting.SeedInfo.seed([6DADDAF691F08EF7]:0) at org.junit.Assert.fail(Assert.java:93) at org.junit.Assert.assertTrue(Assert.java:43) at org.junit.Assert.assertFalse(Assert.java:68) at org.apache.solr.cloud.MultiSolrCloudTestCase.doSetupClusters(MultiSolrCloudTestCase.java:93) at org.apache.solr.cloud.MultiSolrCloudTestCaseTest.setupClusters(MultiSolrCloudTestCaseTest.java:53) ...
With a big of digging I was able to reliably reproduce it by using -Dtests.dups=N (which normally runs in multiple JVMs in parallel) together with -Dtests.jvms=1 constraint so that the tests actually run sequentially in one JVM i.e. altogether
ant test -Dtests.dups=10 -Dtests.jvms=1 -Dtestcase=MultiSolrCloudTestCaseTest
The fix is simple i.e. the static clusterId2collection variable needs to be cleared in @AfterClass as someone (janhoy ?) already mentioned somewhere elsewhere I think.