Search in sources :

Example 1 with SuiteThreadController

use of io.strimzi.systemtest.parallel.SuiteThreadController in project strimzi by strimzi.

the class TestExecutionWatcher method handleAfterAllMethodExecutionException.

@Override
public void handleAfterAllMethodExecutionException(ExtensionContext extensionContext, Throwable throwable) throws Throwable {
    LOGGER.error("{} - Exception {} has been thrown in @AfterAll. Going to collect logs from components.", extensionContext.getRequiredTestClass().getSimpleName(), throwable.getMessage());
    final String testClass = extensionContext.getRequiredTestClass().getName();
    SuiteThreadController suiteThreadController = SuiteThreadController.getInstance();
    if (StUtils.isParallelSuite(extensionContext)) {
        suiteThreadController.removeParallelSuite(extensionContext);
    }
    if (StUtils.isIsolatedSuite(extensionContext)) {
        suiteThreadController.unLockIsolatedSuite();
    }
    collectLogs(extensionContext, new CollectorElement(testClass));
    throw throwable;
}
Also used : SuiteThreadController(io.strimzi.systemtest.parallel.SuiteThreadController) CollectorElement(io.strimzi.test.logs.CollectorElement)

Example 2 with SuiteThreadController

use of io.strimzi.systemtest.parallel.SuiteThreadController in project strimzi-kafka-operator by strimzi.

the class TestExecutionWatcher method handleAfterAllMethodExecutionException.

@Override
public void handleAfterAllMethodExecutionException(ExtensionContext extensionContext, Throwable throwable) throws Throwable {
    LOGGER.error("{} - Exception {} has been thrown in @AfterAll. Going to collect logs from components.", extensionContext.getRequiredTestClass().getSimpleName(), throwable.getMessage());
    final String testClass = extensionContext.getRequiredTestClass().getName();
    SuiteThreadController suiteThreadController = SuiteThreadController.getInstance();
    if (StUtils.isParallelSuite(extensionContext)) {
        suiteThreadController.removeParallelSuite(extensionContext);
    }
    if (StUtils.isIsolatedSuite(extensionContext)) {
        suiteThreadController.unLockIsolatedSuite();
    }
    collectLogs(extensionContext, new CollectorElement(testClass));
    throw throwable;
}
Also used : SuiteThreadController(io.strimzi.systemtest.parallel.SuiteThreadController) CollectorElement(io.strimzi.test.logs.CollectorElement)

Aggregations

SuiteThreadController (io.strimzi.systemtest.parallel.SuiteThreadController)2 CollectorElement (io.strimzi.test.logs.CollectorElement)2