Test: Remove multi process support from rest test runner (#21391)

At one point in the past when moving out the rest tests from core to
their own subproject, we had multiple test classes which evenly split up
the tests to run. However, we simplified this and went back to a single
test runner to have better reproduceability in tests. This change
removes the remnants of that multiplexing support.
This commit is contained in:
Ryan Ernst 2016-11-07 15:07:34 -08:00 committed by GitHub
parent f833114492
commit 7a2c984bcc
47 changed files with 52 additions and 60 deletions

View File

@ -35,6 +35,6 @@ public class DebClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return createParameters(0, 1);
return createParameters();
}
}

View File

@ -35,6 +35,6 @@ public class IntegTestZipClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return createParameters(0, 1);
return createParameters();
}
}

View File

@ -35,6 +35,6 @@ public class RpmClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return createParameters(0, 1);
return createParameters();
}
}

View File

@ -35,6 +35,6 @@ public class TarClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return createParameters(0, 1);
return createParameters();
}
}

View File

@ -35,6 +35,6 @@ public class ZipClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return createParameters(0, 1);
return createParameters();
}
}

View File

@ -37,7 +37,7 @@ public class DocsClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
@Override

View File

@ -34,6 +34,6 @@ public class MatrixStatsClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class IngestCommonClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class LangExpressionClientYamlTestSuiteIT extends ESClientYamlSuiteTestCa
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class LangGroovyClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class LangMustacheClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -37,7 +37,7 @@ public class LangPainlessClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -35,6 +35,6 @@ public class PercolatorClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -35,6 +35,6 @@ public class ReindexClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -39,7 +39,7 @@ public class Netty3ClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -40,7 +40,7 @@ public class Netty4ClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class IcuClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class KuromojiClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class PhoneticClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class SmartCNClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class StempelClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class UkrainianClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class DiscoveryAzureClassicClientYamlTestSuiteIT extends ESClientYamlSuit
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class CloudAwsClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -38,6 +38,6 @@ public class FileBasedDiscoveryClientYamlTestSuiteIT extends ESClientYamlSuiteTe
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class DiscoveryGceClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class IngestAttachmentClientYamlTestSuiteIT extends ESClientYamlSuiteTest
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class IngestGeoIpClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -36,6 +36,6 @@ public class IngestUserAgentClientYamlTestSuiteIT extends ESClientYamlSuiteTestC
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class JvmExampleClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class LangJavascriptClientYamlTestSuiteIT extends ESClientYamlSuiteTestCa
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class LangPythonClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class MapperMurmur3ClientYamlTestSuiteIT extends ESClientYamlSuiteTestCas
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return createParameters(0, 1);
return createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class MapperSizeClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return createParameters(0, 1);
return createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class RepositoryAzureClientYamlTestSuiteIT extends ESClientYamlSuiteTestC
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class RepositoryGcsClientYamlTestSuiteIT extends ESClientYamlSuiteTestCas
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return createParameters(0, 1);
return createParameters();
}
}

View File

@ -35,6 +35,6 @@ public class RepositoryHdfsClientYamlTestSuiteIT extends ESClientYamlSuiteTestCa
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class RepositoryS3ClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class StoreSmbClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -37,7 +37,7 @@ public class Backwards50ClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return createParameters(0, 1);
return createParameters();
}
}

View File

@ -42,7 +42,7 @@ public class UpgradeClusterClientYamlTestSuiteIT extends ESClientYamlSuiteTestCa
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return createParameters(0, 1);
return createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class SmokeTestIngestDisabledClientYamlTestSuiteIT extends ESClientYamlSu
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class SmokeTestIngestWithAllDepsClientYamlTestSuiteIT extends ESClientYam
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class SmokeTestMultiNodeClientYamlTestSuiteIT extends ESClientYamlSuiteTe
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -36,7 +36,7 @@ public class SmokeTestPluginsClientYamlTestSuiteIT extends ESClientYamlSuiteTest
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -35,6 +35,6 @@ public class SmokeTestReindexWithPainlessClientYamlTestSuiteIT extends ESClientY
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
return ESClientYamlSuiteTestCase.createParameters(0, 1);
return ESClientYamlSuiteTestCase.createParameters();
}
}

View File

@ -117,9 +117,9 @@ public abstract class ESClientYamlSuiteTestCase extends ESRestTestCase {
super.afterIfFailed(errors);
}
public static Iterable<Object[]> createParameters(int id, int count) throws IOException, ClientYamlTestParseException {
public static Iterable<Object[]> createParameters() throws IOException, ClientYamlTestParseException {
//parse tests only if rest test group is enabled, otherwise rest tests might not even be available on file system
List<ClientYamlTestCandidate> restTestCandidates = collectTestCandidates(id, count);
List<ClientYamlTestCandidate> restTestCandidates = collectTestCandidates();
List<Object[]> objects = new ArrayList<>();
for (ClientYamlTestCandidate restTestCandidate : restTestCandidates) {
objects.add(new Object[]{restTestCandidate});
@ -127,7 +127,7 @@ public abstract class ESClientYamlSuiteTestCase extends ESRestTestCase {
return objects;
}
private static List<ClientYamlTestCandidate> collectTestCandidates(int id, int count) throws ClientYamlTestParseException, IOException {
private static List<ClientYamlTestCandidate> collectTestCandidates() throws ClientYamlTestParseException, IOException {
List<ClientYamlTestCandidate> testCandidates = new ArrayList<>();
FileSystem fileSystem = getFileSystem();
// don't make a try-with, getFileSystem returns null
@ -140,12 +140,9 @@ public abstract class ESClientYamlSuiteTestCase extends ESRestTestCase {
for (String api : yamlSuites.keySet()) {
List<Path> yamlFiles = new ArrayList<>(yamlSuites.get(api));
for (Path yamlFile : yamlFiles) {
String key = api + yamlFile.getFileName().toString();
if (mustExecute(key, id, count)) {
ClientYamlTestSuite restTestSuite = restTestSuiteParser.parse(api, yamlFile);
for (ClientYamlTestSection testSection : restTestSuite.getTestSections()) {
testCandidates.add(new ClientYamlTestCandidate(restTestSuite, testSection));
}
ClientYamlTestSuite restTestSuite = restTestSuiteParser.parse(api, yamlFile);
for (ClientYamlTestSection testSection : restTestSuite.getTestSections()) {
testCandidates.add(new ClientYamlTestCandidate(restTestSuite, testSection));
}
}
}
@ -164,11 +161,6 @@ public abstract class ESClientYamlSuiteTestCase extends ESRestTestCase {
return testCandidates;
}
private static boolean mustExecute(String test, int id, int count) {
int hash = (int) (Math.abs((long)test.hashCode()) % count);
return hash == id;
}
private static String[] resolvePathsProperty(String propertyName, String defaultValue) {
String property = System.getProperty(propertyName);
if (!Strings.hasLength(property)) {