package org.opendaylight.odlparent.bundlestest;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import static java.util.concurrent.TimeUnit.MINUTES;
+import static java.util.concurrent.TimeUnit.SECONDS;
import static org.junit.Assert.fail;
+import java.util.concurrent.TimeUnit;
import org.apache.karaf.bundle.core.BundleService;
import org.awaitility.Awaitility;
import org.awaitility.core.ConditionTimeoutException;
*
* @author Michael Vorburger, based on guidance from Christian Schneider
*/
- public void checkBundleDiagInfos() {
+ public void checkBundleDiagInfos(long timeout, TimeUnit timeoutUnit) {
try {
Awaitility.await("checkBundleDiagInfos")
.pollDelay(0, MILLISECONDS)
- .pollInterval(250, MILLISECONDS)
- .atMost(5, MINUTES)
+ .pollInterval(1, SECONDS)
+ .atMost(timeout, timeoutUnit)
.conditionEvaluationListener(
- condition -> LOG.info("{} (elapsed time {}ms, remaining time {}ms)",
+ condition -> LOG.info("{} (elapsed time {}s, remaining time {}s)",
((BundleDiagInfos) condition.getValue()).getSummaryText(),
- condition.getElapsedTimeInMS(), condition.getRemainingTimeInMS()))
+ condition.getElapsedTimeInMS() / 1000, condition.getRemainingTimeInMS() / 1000 ))
.until(() -> getBundleDiagInfos(), new BundleServiceSummaryMatcher());
// If we're here then either BundleServiceSummaryMatcher quit because of Active, Failure or Stopping..
package org.opendaylight.odlparent.featuretest;
+import static java.util.concurrent.TimeUnit.SECONDS;
import static org.opendaylight.odlparent.featuretest.Constants.ORG_OPENDAYLIGHT_FEATURETEST_FEATURENAME_PROP;
import static org.opendaylight.odlparent.featuretest.Constants.ORG_OPENDAYLIGHT_FEATURETEST_FEATUREVERSION_PROP;
import static org.opendaylight.odlparent.featuretest.Constants.ORG_OPENDAYLIGHT_FEATURETEST_URI_PROP;
import org.ops4j.pax.exam.CoreOptions;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel;
+import org.ops4j.pax.exam.options.PropagateSystemPropertyOption;
import org.ops4j.pax.exam.options.extra.VMOption;
import org.osgi.framework.BundleContext;
import org.slf4j.Logger;
private static final String KEEP_UNPACK_DIRECTORY_PROP = "karaf.keep.unpack";
private static final String PROFILE_PROP = "karaf.featureTest.profile";
private static final String BUNDLES_DIAG_SKIP_PROP = "sft.diag.skip";
+ private static final String BUNDLES_DIAG_TIMEOUT_PROP = "sft.diag.timeout";
private static final String LOG4J_LOGGER_ORG_OPENDAYLIGHT_YANGTOOLS_FEATURETEST =
"log4j.logger.org.opendaylight.odlparent.featuretest";
*
*/
disableExternalSnapshotRepositories(),
- CoreOptions.systemProperty(ORG_OPENDAYLIGHT_FEATURETEST_URI_PROP).value(
- System.getProperty(ORG_OPENDAYLIGHT_FEATURETEST_URI_PROP)),
- CoreOptions.systemProperty(ORG_OPENDAYLIGHT_FEATURETEST_FEATURENAME_PROP).value(
- System.getProperty(ORG_OPENDAYLIGHT_FEATURETEST_FEATURENAME_PROP)),
- CoreOptions.systemProperty(ORG_OPENDAYLIGHT_FEATURETEST_FEATUREVERSION_PROP).value(
- System.getProperty(ORG_OPENDAYLIGHT_FEATURETEST_FEATUREVERSION_PROP)),
+ new PropagateSystemPropertyOption(ORG_OPENDAYLIGHT_FEATURETEST_URI_PROP),
+ new PropagateSystemPropertyOption(ORG_OPENDAYLIGHT_FEATURETEST_FEATURENAME_PROP),
+ new PropagateSystemPropertyOption(ORG_OPENDAYLIGHT_FEATURETEST_FEATUREVERSION_PROP),
+ new PropagateSystemPropertyOption(BUNDLES_DIAG_SKIP_PROP),
+ new PropagateSystemPropertyOption(BUNDLES_DIAG_TIMEOUT_PROP),
// Needed for Agrona/aeron.io
CoreOptions.systemPackages("com.sun.media.sound", "sun.nio.ch"),
};
if (!Boolean.getBoolean(BUNDLES_DIAG_SKIP_PROP)
&& !BLACKLISTED_BROKEN_FEATURES.contains(getFeatureName())) {
- new TestBundleDiag(bundleContext, bundleService).checkBundleDiagInfos();
+ Integer timeOutInSeconds = Integer.getInteger(BUNDLES_DIAG_TIMEOUT_PROP, 5 * 60);
+ new TestBundleDiag(bundleContext, bundleService).checkBundleDiagInfos(timeOutInSeconds, SECONDS);
} else {
LOG.warn("SKIPPING TestBundleDiag because system property {} is true or feature is blacklisted: {}",
BUNDLES_DIAG_SKIP_PROP, getFeatureName());