-
Notifications
You must be signed in to change notification settings - Fork 735
CONSOLE-5196: Fix Playwright e2e flakes and CI reliability #16863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| import { isNotFound } from '../../../clients/kubernetes-client'; | ||
| import { test, expect } from '../../../fixtures'; | ||
|
|
||
| test.describe('Favorites', { tag: ['@admin'] }, () => { | ||
|
|
@@ -11,8 +12,8 @@ test.describe('Favorites', { tag: ['@admin'] }, () => { | |
| 'openshift-console-user-settings', | ||
| { 'console.favorites': '[]', 'console.lastNamespace': '' }, | ||
| ); | ||
| } catch { | ||
| // ConfigMap may not exist yet | ||
| } catch (e) { | ||
| if (!isNotFound(e)) throw e; | ||
| } | ||
| }); | ||
|
|
||
|
|
@@ -120,5 +121,16 @@ test.describe('Favorites', { tag: ['@admin'] }, () => { | |
| await expect(page.getByTestId('favorite-button').first()).toBeDisabled(); | ||
| }); | ||
|
|
||
| await test.step('Remove all favorites to clean up for future runs', async () => { | ||
| try { | ||
| await k8sClient.patchConfigMap( | ||
| 'user-settings-kubeadmin', | ||
| 'openshift-console-user-settings', | ||
| { 'console.favorites': '[]' }, | ||
| ); | ||
| } catch (e) { | ||
| if (!isNotFound(e)) throw e; | ||
| } | ||
| }); | ||
|
Comment on lines
+124
to
+134
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win Guarantee ConfigMap cleanup after failures. This cleanup step is skipped when any preceding assertion or navigation fails, leaving persistent 🤖 Prompt for AI Agents |
||
| }); | ||
| }); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Attach the no-op catch when
initPromiseis created, not infinally.The 90s timer can reject
initPromisewhile control is still insidepage.goto()or the 60s dashboard-visibility wait. Until line 76 runs, that rejection has no handler, which can surface as an unhandled rejection. Attaching the guard at creation makes it unconditional.🛡️ Proposed fix
const initPromise = new Promise<void>((resolve, reject) => { initResolve = resolve; initReject = reject; }); + // Guard against the timeout rejecting before `await initPromise` is reached. + initPromise.catch(() => {}); @@ } finally { clearTimeout(timer); page.off('framenavigated', resetOnNav); page.off('response', onResponse); - initPromise.catch(() => {}); }Also applies to: 61-64, 76-76
🤖 Prompt for AI Agents