use of com.hazelcast.simulator.coordinator.TestCaseRunner in project hazelcast-simulator by hazelcast.
the class RunTestSuiteTask method runParallel.
private boolean runParallel() {
final AtomicBoolean success = new AtomicBoolean(true);
ThreadSpawner spawner = new ThreadSpawner("runParallel", true);
for (final TestCaseRunner runner : runners) {
spawner.spawn(new Runnable() {
@Override
public void run() {
try {
if (!runner.run()) {
success.set(false);
}
} catch (Exception e) {
throw rethrow(e);
}
}
});
}
spawner.awaitCompletion();
return success.get();
}
use of com.hazelcast.simulator.coordinator.TestCaseRunner in project hazelcast-simulator by hazelcast.
the class RunTestSuiteTask method run0.
private boolean run0(List<TestData> tests, List<WorkerData> targets) {
int testCount = testSuite.size();
boolean parallel = testSuite.isParallel() && testCount > 1;
Map<TestPhase, CountDownLatch> testPhaseSyncMap = getTestPhaseSyncMap(testCount, parallel, coordinatorParameters.getLastTestPhaseToSync());
LOGGER.info("Starting TestSuite");
echoTestSuiteDuration(parallel);
for (TestData test : tests) {
int testIndex = test.getTestIndex();
TestCase testCase = test.getTestCase();
LOGGER.info(format("Configuration for %s (T%d):%n%s", testCase.getId(), testIndex, testCase));
TestCaseRunner runner = new TestCaseRunner(test, coordinatorParameters, targets, client, testPhaseSyncMap, failureCollector, registry, performanceStatsCollector);
runners.add(runner);
}
echoTestSuiteStart(testCount, parallel);
long started = System.nanoTime();
boolean success = parallel ? runParallel() : runSequential();
echoTestSuiteEnd(testCount, started);
return success;
}
Aggregations