@camunda/e2e-test-suite 0.0.1477 → 0.0.1478
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -20,7 +20,7 @@ declare class NavigationPage {
|
|
|
20
20
|
goToTasklist(sleepTimeout?: number): Promise<void>;
|
|
21
21
|
goToOperate(sleepTimeout?: number): Promise<void>;
|
|
22
22
|
goToOptimize(sleepTimeout?: number): Promise<void>;
|
|
23
|
-
goToKeycloak(maxRetries?: number): Promise<void>;
|
|
23
|
+
goToKeycloak(maxRetries?: number, retryWindowMs?: number): Promise<void>;
|
|
24
24
|
goToIdentity(sleepTimeout?: number): Promise<void>;
|
|
25
25
|
goToConsole(sleepTimeout?: number): Promise<void>;
|
|
26
26
|
}
|
|
@@ -134,12 +134,16 @@ class NavigationPage {
|
|
|
134
134
|
async goToOptimize(sleepTimeout) {
|
|
135
135
|
await this.goTo(OPTIMIZE_CONTEXT_PATH, this.optimizePageBanner, sleepTimeout);
|
|
136
136
|
}
|
|
137
|
-
async goToKeycloak(maxRetries = 5) {
|
|
137
|
+
async goToKeycloak(maxRetries = 5, retryWindowMs = 90000) {
|
|
138
138
|
const keycloakUrl = process.env.KEYCLOAK_URL
|
|
139
139
|
? `${process.env.KEYCLOAK_URL}/auth`
|
|
140
140
|
: '/auth';
|
|
141
|
+
const startTime = Date.now();
|
|
141
142
|
let lastError;
|
|
142
|
-
|
|
143
|
+
let attempt = 0;
|
|
144
|
+
// Fast failures such as NS_ERROR_CONNECTION_REFUSED would exhaust
|
|
145
|
+
// maxRetries in ~20s, so keep retrying until retryWindowMs has elapsed.
|
|
146
|
+
while (attempt < maxRetries || Date.now() - startTime < retryWindowMs) {
|
|
143
147
|
try {
|
|
144
148
|
await this.page.goto(keycloakUrl);
|
|
145
149
|
await (0, test_1.expect)(this.keyboardPageBanner).toBeVisible({ timeout: 60000 });
|
|
@@ -147,14 +151,20 @@ class NavigationPage {
|
|
|
147
151
|
}
|
|
148
152
|
catch (error) {
|
|
149
153
|
lastError = error;
|
|
150
|
-
|
|
151
|
-
|
|
154
|
+
attempt++;
|
|
155
|
+
const backoffMs = Math.min(5000 * attempt, 15000);
|
|
156
|
+
if (attempt < maxRetries ||
|
|
157
|
+
Date.now() - startTime + backoffMs < retryWindowMs) {
|
|
158
|
+
await (0, sleep_1.sleep)(backoffMs);
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
break;
|
|
152
162
|
}
|
|
153
163
|
}
|
|
154
164
|
}
|
|
155
165
|
throw lastError instanceof Error
|
|
156
166
|
? lastError
|
|
157
|
-
: new Error(`goToKeycloak failed after ${
|
|
167
|
+
: new Error(`goToKeycloak failed after ${attempt} attempts`);
|
|
158
168
|
}
|
|
159
169
|
async goToIdentity(sleepTimeout) {
|
|
160
170
|
await this.goTo('/identity', this.identityPageBanner, sleepTimeout);
|