@camunda/e2e-test-suite 0.0.1722 → 0.0.1724

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.
@@ -6,6 +6,7 @@ const sleep_1 = require("../../utils/sleep");
6
6
  const clickLocatorWithRetry_1 = require("../../utils/assertionHelpers/clickLocatorWithRetry");
7
7
  const expectLocatorWithRetry_1 = require("../../utils/assertionHelpers/expectLocatorWithRetry");
8
8
  const ClientCredentialsDetailsPage_1 = require("./ClientCredentialsDetailsPage");
9
+ const consoleApiHelpers_1 = require("../../utils/consoleApiHelpers");
9
10
  const sessionRecovery_1 = require("../../utils/sessionRecovery");
10
11
  // Hub's own /login and /login-callback routes, which render only a spinner
11
12
  // while the Auth0 hand-off of a full page load is in flight.
@@ -772,8 +773,10 @@ class ClusterDetailsPage {
772
773
  for (const component of components) {
773
774
  await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, this.page.getByText(`${component}Healthy`, { exact: true }), {
774
775
  visibilityTimeout: 60000,
775
- totalTimeout: 300000,
776
- maxRetries: 5,
776
+ // Raised from 300s: attempts may now wait out the rate limiter
777
+ // (waitForRateLimitToClear) before reloading.
778
+ totalTimeout: 600000,
779
+ maxRetries: 7,
777
780
  preAction: async () => {
778
781
  // Hub logs the tab out when its backend fails the session call
779
782
  // (/api/internal/self 5xx), and from then on a reload only
@@ -789,6 +792,13 @@ class ClusterDetailsPage {
789
792
  .catch(() => { });
790
793
  return;
791
794
  }
795
+ // A reload is a full Hub load plus Auth0 round-trip. Fired into an
796
+ // exhausted Envoy rate limit it just re-renders "fetch error", so
797
+ // the badge never appears and the whole retry budget is spent
798
+ // reloading into a drained bucket (the HTTP 429 burst this run hit
799
+ // on GET /clusters). Let the limiter admit a cheap request again
800
+ // first, mirroring pages/8.10/ClusterDetailsPage.ts.
801
+ await (0, consoleApiHelpers_1.waitForRateLimitToClear)(this.page);
792
802
  await this.page.reload();
793
803
  },
794
804
  });
@@ -56,8 +56,20 @@ _8_11_1.test.describe('Agentic Control Plane Dashboard API Tests @agentic-dashbo
56
56
  (0, _8_11_1.test)('Dashboard API uses current terminology and not legacy wording', async ({ page, appsPage, optimizeHomePage, }) => {
57
57
  const responses = await (0, agenticDashboardHelpers_1.captureDashboardResponses)(page, async () => {
58
58
  await (0, agenticDashboardHelpers_1.openAgenticControlPlane)(page, appsPage, optimizeHomePage, clusterName);
59
- });
60
- const dashboardResponses = responses.filter(agenticDashboardHelpers_1.isLikelyDashboardApiResponse);
59
+ }, { includeNonJsonReportEvaluations: true });
60
+ // The report names (where the terminology lives) are only in successful
61
+ // report evaluations. During an Optimize backend 5xx burst (nightly
62
+ // 45107178172: every agentic report evaluation returned 500 for ~2 min)
63
+ // the captured bodies are error payloads and the terminology check fails
64
+ // for the wrong reason. Wait for a healthy load first, and assert it, so a
65
+ // persistent 5xx still fails here with an explicit message.
66
+ const reportResponses = await (0, agenticDashboardHelpers_1.reloadUntilDashboardReportsHealthy)(page, responses, 6, 10000);
67
+ (0, test_1.expect)(reportResponses.filter((r) => r.status !== 200).map((r) => r.url), 'dashboard report evaluations returned non-200').toEqual([]);
68
+ (0, test_1.expect)(reportResponses.length).toBeGreaterThan(0);
69
+ const dashboardResponses = [
70
+ ...responses.filter(agenticDashboardHelpers_1.isAgenticDashboardDefinitionResponse),
71
+ ...reportResponses,
72
+ ];
61
73
  (0, test_1.expect)(dashboardResponses.length).toBeGreaterThan(0);
62
74
  const joined = dashboardResponses
63
75
  .map((r) => r.bodyText)
@@ -41,11 +41,12 @@ export declare function captureDashboardResponses(page: Page, action: () => Prom
41
41
  }): Promise<CapturedResponse[]>;
42
42
  /**
43
43
  * Waits until the agentic dashboard's initial report evaluations all return
44
- * 200, reloading the page (up to `maxReloads` times) while the Optimize
45
- * backend is still answering some of them with 5xx. Returns the report
46
- * evaluate responses of the last load so the caller can assert on them.
44
+ * 200, reloading the page (up to `maxReloads` times, polling with a
45
+ * `backoffMs * n` interval after the n-th reload) while the Optimize backend
46
+ * is still answering some of them with 5xx. Returns the report evaluate
47
+ * responses of the last load so the caller can assert on them.
47
48
  */
48
- export declare function reloadUntilDashboardReportsHealthy(page: Page, initialResponses: CapturedResponse[], maxReloads?: number): Promise<CapturedResponse[]>;
49
+ export declare function reloadUntilDashboardReportsHealthy(page: Page, initialResponses: CapturedResponse[], maxReloads?: number, backoffMs?: number): Promise<CapturedResponse[]>;
49
50
  export declare function parseJsonResponseBodies(responses: CapturedResponse[]): unknown[];
50
51
  export declare function findReportByName(bodies: unknown[], name: string): unknown;
51
52
  export declare function getReportNumericResult(body: unknown): number | undefined;
@@ -145,19 +145,33 @@ async function captureDashboardResponses(page, action, options = {}) {
145
145
  exports.captureDashboardResponses = captureDashboardResponses;
146
146
  /**
147
147
  * Waits until the agentic dashboard's initial report evaluations all return
148
- * 200, reloading the page (up to `maxReloads` times) while the Optimize
149
- * backend is still answering some of them with 5xx. Returns the report
150
- * evaluate responses of the last load so the caller can assert on them.
148
+ * 200, reloading the page (up to `maxReloads` times, polling with a
149
+ * `backoffMs * n` interval after the n-th reload) while the Optimize backend
150
+ * is still answering some of them with 5xx. Returns the report evaluate
151
+ * responses of the last load so the caller can assert on them.
151
152
  */
152
- async function reloadUntilDashboardReportsHealthy(page, initialResponses, maxReloads = 3) {
153
+ async function reloadUntilDashboardReportsHealthy(page, initialResponses, maxReloads = 3, backoffMs = 0) {
153
154
  const isHealthy = (reports) => reports.length > 0 && reports.every((r) => r.status === 200);
154
155
  let reports = initialResponses.filter(isReportEvaluateResponse);
155
- for (let attempt = 0; attempt < maxReloads && !isHealthy(reports); attempt++) {
156
+ if (maxReloads <= 0 || isHealthy(reports))
157
+ return reports;
158
+ // Bounded by count, not by toPass's timeout: the block passes once the
159
+ // reports are healthy OR the reload budget is spent, so on exhaustion the
160
+ // last load is returned and the caller's own assertion names the failure.
161
+ // Optional linear backoff between reloads: a 5xx burst can outlast a few
162
+ // quick reloads.
163
+ const intervals = backoffMs > 0
164
+ ? Array.from({ length: maxReloads }, (_, i) => backoffMs * (i + 1))
165
+ : [0];
166
+ let reloads = 0;
167
+ await (0, test_1.expect)(async () => {
168
+ reloads++;
156
169
  const responses = await captureDashboardResponses(page, async () => {
157
170
  await page.reload({ waitUntil: 'domcontentloaded' });
158
171
  }, { includeNonJsonReportEvaluations: true });
159
172
  reports = responses.filter(isReportEvaluateResponse);
160
- }
173
+ (0, test_1.expect)(isHealthy(reports) || reloads >= maxReloads, 'dashboard report evaluations not yet healthy').toBe(true);
174
+ }).toPass({ intervals, timeout: 0 });
161
175
  return reports;
162
176
  }
163
177
  exports.reloadUntilDashboardReportsHealthy = reloadUntilDashboardReportsHealthy;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1722",
3
+ "version": "0.0.1724",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",