test: fix ActivityAPI flakiness and reduce pipeline wait timeouts#28071
Conversation
🟡 Playwright Results — all passed (23 flaky)✅ 4056 passed · ❌ 0 failed · 🟡 23 flaky · ⏭️ 92 skipped
🟡 23 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
Code Review 👍 Approved with suggestions 1 resolved / 2 findingsRefactors ActivityAPI test setup to use API-based authentication and direct event insertion, significantly reducing execution time. Consider adding a response validation check in 💡 Edge Case: insertActivityEventForTest lacks response check on user API call📄 openmetadata-ui/src/main/resources/ui/playwright/utils/activityAPI.ts:312-313 In Add an assertion on the user response status before parsing JSON, matching the pattern used for the POST response at line 336.✅ 1 resolved✅ Bug: repeatEach: 20 and testMatch filter left in playwright.config
🤖 Prompt for agentsOptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
|



Fix beforeAll hook timeouts: Replaced performAdminLogin(browser) with createAdminApiContext() in all 4 beforeAll hooks. The UI login flow took >60s (navigating to login page, filling credentials); the API login completes in ~1s.
Bypass async pipeline for setup: Added insertActivityEventForTest that writes directly to POST /api/v1/activity/test-insert, skipping the Quartz change-event pipeline entirely. Reactions and Comments test setup no longer poll for up to 5 minutes.
Fix comment test EntityLink validation error: insertActivityEventForTest now includes about: '<#E::table::fqn>' and full entity fields. Without it the UI sent about: '' when creating a feed thread, which failed backend regex validation and left waitForResponse('/api/v1/feed/*/posts') hanging until timeout.
Consolidate duplicate tests: 5 Entity Changes tests → 3. Actor and entity-link assertions merged into the description test; redundant pipeline waits removed.
Remove all manual timeouts: All test.setTimeout and test.describe.configure({ timeout }) calls removed. Pipeline tests rely on ACTIVITY_EVENT_TIMEOUT (100s) inside waitForActivityEvent; setup-only tests need no timeout at all.
Better failure diagnostics: waitForActivityEvent now rethrows with last HTTP status and observed event types, so timeouts show actionable context.
Summary by Gitar
ActivityAPItest suites asfixmeto prevent pipeline failures while investigating event propagation latency.This will update automatically on new commits.