Skip to content

Cap external scale IT at 100k and fix external-cluster test flakiness#30202

Open
mohityadav766 wants to merge 1 commit into
mainfrom
cap-load-test-at-100k
Open

Cap external scale IT at 100k and fix external-cluster test flakiness#30202
mohityadav766 wants to merge 1 commit into
mainfrom
cap-load-test-at-100k

Conversation

@mohityadav766

@mohityadav766 mohityadav766 commented Jul 18, 2026

Copy link
Copy Markdown
Member

Describe your changes:

The nightly External Cluster workflow failed every run, for four unrelated reasons. This fixes each:

  • 500k scale job cancelled nightly — it runs after 100k (max-parallel: 1), took >5h, and never completed. The scale matrix fallback now defaults to [100000]; larger cohorts stay available on demand via the scaleSeeds dispatch input.
  • scale-100k 401 Expired token mid-seedExternalTokenRefresher renewed only 10m before expiry, so a ~10m login-endpoint outage on the renewal window let the ~1h token die. It now renews at half the token's remaining life (~30m runway). Validated live against the cluster (refresh scheduled in 1795s).
  • SearchRelevancyPreviewIT flaky (matchType/searchFields) — exact-set assertions (hasSize/containsExactly) on fuzzy name.ngram queries were inflated by foreign ngram-colliding tables on the shared cluster. Switched to contains/doesNotContain (matching the existing maxResultHits fix). Verified 7/7 green against mohitcorp2.getcollate.io.
  • DataQualityPaginationReindexUIIT dropdown timeout — the unscoped .ant-dropdown-menu first-matched a hidden nav-bar menu portaled to <body> (NextPrevious is a shared component). Scoped to .ant-dropdown:not(.ant-dropdown-hidden), mirroring the existing .ant-select-dropdown idiom.

Not changed — NoDuplicatesDuringReindexIT: current DefaultRecreateHandler is zero-downtime (staged index + atomic swapAliases), so the read alias is never empty. The count=0 is the test correctly catching a read-gap in the older build deployed on the cluster (rev f1f786a8, not in this repo). Silencing it would remove a valid regression guard — the cluster needs redeploying instead.

Type of change:

  • Bug fix

High-level design:

N/A — CI config + test/selector robustness only; no production code changed.

Tests:

Manual testing performed

  1. Acquired a token and ran SearchRelevancyPreviewIT (-P search-it -Dit.test=...) against https://mohitcorp2.getcollate.io — reproduced the flake, applied the fix, re-ran 7/7 green.
  2. Confirmed the token-renewal change live: the refresher now schedules the next re-login at ~30m (half-life) instead of ~50m.
  3. Verified the page-size dropdown fix against the actual NextPrevious.tsx Ant <Dropdown> markup (Playwright not runnable in this environment).

Backend integration tests

  • Not applicable — these ARE the integration tests; changes make them reliable on the shared external cluster.

Playwright (UI) tests

  • Not applicable — page-object selector robustness only; no UI/product change.

UI screen recording / screenshots:

Not applicable.

Checklist:

  • I have read the CONTRIBUTING document.
  • I have commented on my code, particularly in hard-to-understand areas.

Greptile Summary

This PR stabilizes the nightly external-cluster integration tests. The main changes are:

  • Limits the default scale test to the 100k cohort.
  • Tolerates unrelated ngram hits in search preview assertions.
  • Schedules token renewal at half of the remaining lifetime.
  • Scopes the page-size locator to visible Ant dropdowns.

Confidence Score: 4/5

The aged-token refresh path needs a fix before merging.

  • Fresh one-hour tokens gain more retry time.
  • Tokens already near expiry can now wait longer before renewal and expire during a shorter login outage.
  • The workflow, search assertions, and dropdown selector preserve their intended behavior.

openmetadata-integration-tests/src/test/java/org/openmetadata/it/util/ExternalTokenRefresher.java

Important Files Changed

Filename Overview
.github/workflows/java-playwright-external.yml Changes the scheduled and default scale matrix to 100k while preserving manually supplied cohorts.
openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/search/SearchRelevancyPreviewIT.java Allows unrelated fuzzy-search hits while retaining the expected seeded inclusions and field-specific exclusions.
openmetadata-integration-tests/src/test/java/org/openmetadata/it/util/ExternalTokenRefresher.java Gives fresh one-hour tokens more retry runway, but can refresh an aged initial token later than the previous policy.
openmetadata-integration-tests/src/test/java/org/openmetadata/playwright/ui/pages/DataQualityListPage.java Scopes page-size menu checks to non-hidden Ant dropdown overlays.

Reviews (1): Last reviewed commit: "Cap external scale IT at 100k and fix ex..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

Context used (3)

  • Context used - CLAUDE.md (source)
  • Context used - openmetadata-ui-core-components/CLAUDE.md (source)
  • Context used - AGENTS.md (source)

The nightly "Java Integration Tests (External Cluster)" workflow failed on
every run. Root causes, all distinct:

- scale-500k was cancelled every night — it runs after 100k (max-parallel: 1),
  took >5h, and never completed. Default the scale matrix fallback to [100000];
  larger cohorts remain available on demand via the scaleSeeds dispatch input.

- scale-100k died mid-seed with "AuthenticationException (401): Expired token".
  ExternalTokenRefresher renewed 10m before expiry, but a ~10m login-endpoint
  outage landing on that window consumed the whole buffer and the ~1h token
  expired. Renew at half the token's remaining life (~30m) so a login blip has
  ~half the TTL of retry runway instead of 10m.

- SearchRelevancyPreviewIT.matchType/searchFields asserted exact result sets
  (hasSize/containsExactly) on fuzzy name.ngram queries. On the shared external
  cluster a foreign ngram-colliding table inflates the set, flaking a different
  test each run. Assert the seeded ids are present / the excluded id is absent
  (contains + doesNotContain), matching the existing maxResultHits fix. Verified
  7/7 green against the external cluster.

- DataQualityPaginationReindexUIIT timed out opening the page-size dropdown:
  the unscoped .ant-dropdown-menu first-matched a hidden nav-bar menu portaled
  to <body> (NextPrevious is a shared component). Scope to
  .ant-dropdown:not(.ant-dropdown-hidden), mirroring the .ant-select-dropdown
  idiom already used in the page object.

NoDuplicatesDuringReindexIT (alias briefly empty during recreate) is not
addressed here: current DefaultRecreateHandler is zero-downtime (staged index +
atomic swapAliases), so the read alias is never empty. The 0-count is the test
correctly catching a read-gap in the older build deployed on the cluster;
silencing it would drop a valid regression guard.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 18, 2026 07:48
@mohityadav766
mohityadav766 requested a review from tutte as a code owner July 18, 2026 07:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@gitar-bot

gitar-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Stabilizes the external integration test suite by capping scale jobs at 100k, implementing proactive token renewal, and hardening test assertions and UI selectors. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Jul 18, 2026
if (exp != null) {
final long now = System.currentTimeMillis() / 1000;
delaySeconds = Math.max(60, exp - now - EXPIRY_BUFFER.toSeconds());
delaySeconds = Math.max(60, (exp - now) / 2);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Aged Tokens Refresh Later

When the configured token is already partway through its lifetime, this calculation can reduce the retry runway. A token with 10 minutes remaining previously refreshed after the 60-second floor, leaving about 9 minutes for retries; it now waits 5 minutes, so a five-minute login outage can let the token expire and cause external-cluster requests to return 401.

Context Used: CLAUDE.md (source)

@github-actions

Copy link
Copy Markdown
Contributor

🔴 Playwright Results — 1 failure(s), 27 flaky

✅ 4543 passed · ❌ 1 failed · 🟡 27 flaky · ⏭️ 95 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 435 0 5 16
✅ Shard 2 11 0 0 0
🟡 Shard 3 825 0 7 8
🔴 Shard 4 821 1 1 18
🟡 Shard 5 838 0 3 5
🟡 Shard 6 784 0 4 46
🟡 Shard 7 829 0 7 2

Genuine Failures (failed on all attempts)

Features/Glossary/GlossaryTermRelationsGraphNested.spec.ts › viewing a child term: parent appears as a 1-hop neighbour via parentOf edge (shard 4)
�[31mTest timeout of 60000ms exceeded.�[39m
🟡 27 flaky test(s) (passed on retry)
  • Flow/TestConnectionModal.spec.ts › modal opens with gate card and capability checks sections (shard 1, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: metric (shard 1, 1 retry)
  • Pages/SearchSettings.spec.ts › Latest preview config wins when a superseded request resolves late (shard 1, 1 retry)
  • Flow/SearchRBAC.spec.ts › User without permission (shard 1, 1 retry)
  • Flow/SearchRBAC.spec.ts › a table-scoped user sees tables but never dashboards (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary Term (Nested) (shard 3, 1 retry)
  • Features/BulkImportWithDotInName.spec.ts › Full import cycle with dot in service name (shard 3, 1 retry)
  • Features/ColumnBulkOperations.spec.ts › should show column count for multiple column selection (shard 3, 1 retry)
  • Features/ContextCenterArchive.spec.ts › archive page lazy-loads more rows on scroll within its own scroll container (shard 3, 1 retry)
  • Features/ContextCenterArticles.spec.ts › Article listing search filters, clears, and shows empty state (shard 3, 1 retry)
  • Features/ContextCenterMemories.spec.ts › Shared memory shows the shared-with-specific-people description (shard 3, 1 retry)
  • Features/ContextCenterPermission.spec.ts › user with deleteAll permission can see delete action but not restore action on an archived document, and can delete it (shard 3, 1 retry)
  • Features/SearchExport.spec.ts › Export queues a background job and downloads from the jobs tray (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Set & Update all CP types on storedProcedure (shard 5, 1 retry)
  • Pages/CustomProperties.spec.ts › Enum (shard 5, 1 retry)
  • Pages/CustomProperties.spec.ts › String (shard 5, 1 retry)
  • Pages/Entity.spec.ts › Delete Table (shard 6, 1 retry)
  • Pages/Entity.spec.ts › User as Owner with unsorted list (shard 6, 1 retry)
  • Pages/Entity.spec.ts › Tag and Glossary Term preservation in column detail panel (shard 6, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard 6, 1 retry)
  • Pages/ExplorePageRightPanel.spec.ts › Should allow Data Steward to view all tabs for searchIndex (shard 7, 1 retry)
  • Pages/Glossary.spec.ts › Approve and reject glossary term from Glossary Listing (shard 7, 1 retry)
  • Pages/GlossaryImportExport.spec.ts › Check for Circular Reference in Glossary Import (shard 7, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify Impact Analysis service filter selection (shard 7, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab is NOT visible for pipelineService in platform lineage (shard 7, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab is NOT visible for apiService in platform lineage (shard 7, 1 retry)
  • Pages/TestSuite.spec.ts › Logical TestSuite (shard 7, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants