improve migration integration test, fix wait
@@ -235,8 +235,6 @@ public class RegistryFacade {
public void waitForRegistryReady() throws Exception {
- if (RegistryUtils.TEST_PROFILE.contains(Constants.CLUSTERED)) {
-
ThrowingConsumer<Integer> nodeIsReady = (port) -> {
TestUtils.waitFor("Cannot connect to registries on node :" + port + " in timeout!",
Constants.POLL_INTERVAL, Constants.TIMEOUT_FOR_REGISTRY_START_UP, () -> TestUtils.isReachable("localhost", port, "registry node"));
@@ -247,6 +245,8 @@ public class RegistryFacade {
() -> TestUtils.isReady("http://localhost:" + port, "/health/ready", true, "registry node"));
};
+ if (RegistryUtils.TEST_PROFILE.contains(Constants.CLUSTERED)) {
+
try {
nodeIsReady.accept(TestUtils.getRegistryPort());
int c2port = TestUtils.getRegistryPort() + 1;
@@ -256,6 +256,17 @@ public class RegistryFacade {
} catch (Throwable e) {
throw new Exception(e);
}
+
+ } if (RegistryUtils.TEST_PROFILE.contains(Constants.MIGRATION)) {
+
+ try {
+ nodeIsReady.accept(TestUtils.getRegistryPort());
+ int c2port = TestUtils.getRegistryPort() + 1;
+ nodeIsReady.accept(c2port);
+ } catch (Throwable e) {
+ throw new Exception(e);
+ }
+
} else {
TestUtils.waitFor("Cannot connect to registries on " + TestUtils.getRegistryV1ApiUrl() + " in timeout!",
Constants.POLL_INTERVAL, Constants.TIMEOUT_FOR_REGISTRY_START_UP, TestUtils::isReachable);
