fix: resolve flaky workspace settings e2e test #1605
+10
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Issue: #1531
Description
Fixed the flaky E2E test
e2e/tests/settings/administrator/workspace.spec.ts.Problem
The e2e test allows updating workspace settings in
workspace.spec.tsis flaky. After clicking "Save changes" and confirming the "Changes saved" toast, the test immediately queries the database to verify the update. However, the toast appearing does not guarantee the database transaction has fully committed, causing a race condition where assertions fail intermittently.Solution
Wrapped the database assertions in Playwright's
expect(async () => { ... }).toPass()retry mechanism. This polls the database until the expected values match or the configured timeout (30s) is reached, eliminating the race condition between the UI confirmation and the database commit.Before/After
No UI changes — this is a test-only fix.
Test Results
Run
pnpm playwright test e2e/tests/settings/administrator/workspace.spec.ts --workers=1 --repeat-each=5Checklist
AI Disclosure
Claude Opus 4.5 was used to analyze the flaky test.