Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Make startup time limit dynamic (#2451)

Eric Bariauxe3758fa5009d
diff --git a/setup/src/load2/java/org/openremote/setup/load2/KeycloakSetup.java b/setup/src/load2/java/org/openremote/setup/load2/KeycloakSetup.java
index 20ed24d25..e233ced2b 100644
--- a/setup/src/load2/java/org/openremote/setup/load2/KeycloakSetup.java
+++ b/setup/src/load2/java/org/openremote/setup/load2/KeycloakSetup.java
@@ -89,8 +89,9 @@ public class KeycloakSetup extends AbstractKeycloakSetup {
// Wait until all users created
int waitCounter = 0;
+ int waitCounterLimit = accounts / 3;
while (createdUsers.get() < 2 * accounts) {
- if (waitCounter > 1000) {
+ if (waitCounter > waitCounterLimit) {
throw new IllegalStateException("Failed to add all requested user in the specified time");
}
waitCounter++;
diff --git a/setup/src/load2/java/org/openremote/setup/load2/ManagerSetup.java b/setup/src/load2/java/org/openremote/setup/load2/ManagerSetup.java
index 6414a9149..f4c38ebfb 100644
--- a/setup/src/load2/java/org/openremote/setup/load2/ManagerSetup.java
+++ b/setup/src/load2/java/org/openremote/setup/load2/ManagerSetup.java
@@ -78,6 +78,7 @@ public class ManagerSetup extends org.openremote.manager.setup.ManagerSetup {
// Wait until all devices created
int waitCounter = 0;
+ int waitCounterLimit = (accounts * assets) / 150;
while (createdAccounts.get() < accounts) {
if (waitCounter > 200) {
throw new IllegalStateException("Failed to provision all requested devices in the specified time");