Skip to content

Commit dbb757a

Browse files
committed
Cleanup controller tests
Ensure that we wait until lighty.io controller is started or stopped. JIRA: LIGHTY-299 Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech> (cherry picked from commit f82ca5f)
1 parent 681380f commit dbb757a

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

lighty-core/lighty-controller-guice-di/src/test/java/io/lighty/core/controller/guice/tests/GuiceDITest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void init() throws ExecutionException, InterruptedException, Configuratio
5050
public void shutdown() {
5151
try {
5252
if (lightyController != null) {
53-
lightyController.shutdown();
53+
lightyController.shutdown().get();
5454
}
5555
} catch (Exception e) {
5656
LOG.error("Shutdown of LightyController failed", e);

lighty-core/lighty-controller-spring-di/src/test/java/io/lighty/core/controller/spring/LightyCoreSpringConfigurationTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public LightyController initLightyController() throws LightyLaunchException, Int
214214
public void shutdownLightyController(LightyController lightyController) throws LightyLaunchException {
215215
try {
216216
LOG.info("Shutting down LightyController ...");
217-
lightyController.shutdown();
217+
lightyController.shutdown().get();
218218
} catch (Exception e) {
219219
throw new LightyLaunchException("Could not shutdown LightyController", e);
220220
}

lighty-core/lighty-controller/src/test/java/io/lighty/core/controller/api/LightyModuleTest.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@
2424
import org.testng.annotations.Test;
2525

2626
public class LightyModuleTest {
27-
private static long MAX_INIT_TIMEOUT = 15000L;
28-
private static long MAX_SHUTDOWN_TIMEOUT = 15000L;
29-
private static long SLEEP_AFTER_SHUTDOWN_TIMEOUT = 800L;
27+
private static final long MAX_INIT_TIMEOUT = 15000L;
28+
private static final long MAX_SHUTDOWN_TIMEOUT = 15000L;
29+
private static final long SLEEP_AFTER_SHUTDOWN_TIMEOUT = 800L;
30+
3031
private ExecutorService executorService;
3132
private LightyModule moduleUnderTest;
3233

lighty-modules/lighty-restconf-nb-community/src/test/java/io/lighty/modules/northbound/restconf/community/impl/tests/CommunityRestConfTestBase.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public void startControllerAndRestConf() throws Exception {
5353
communityRestConf = builder.build();
5454

5555
LOG.info("Starting CommunityRestConf (waiting 10s after start)");
56-
communityRestConf.start();
56+
communityRestConf.start().get(10_000, TimeUnit.MILLISECONDS);
5757
LOG.info("CommunityRestConf started");
5858
}
5959

0 commit comments

Comments
 (0)