Skip to content

flake: adjust user theme preference (Playwright e2e) #1291

@flake-investigator

Description

@flake-investigator

CI Run: https://github.com/coder/coder/actions/runs/21266584227
Commit: 6c49938fca29ed6a399c0758dd5936868b0b8eab ("feat: add template version ID to re-emitted boundary logs (#21636)")
Failed job: test-e2e

Failure:

  • Playwright test: site/e2e/tests/users/userSettings.spec.tsadjust user theme preference
  • Assertion failed after navigating away from /settings/appearance:
    • Expected substring: "light"
    • Received string: "dark"

Log excerpt:

1) [tests] › e2e/tests/users/userSettings.spec.ts:10:5 › adjust user theme preference

Error: expect(received).toContain(expected)

Expected substring: "light"
Received string:    "dark"

> 27 | expect(await homeRoot.evaluate((it) => it.className)).toContain("light");
     |                                                      ^
  at /home/runner/work/coder/coder/site/e2e/tests/users/userSettings.spec.ts:27:56

Artifacts:

Notes / likely root cause:

  • The test selects the Light theme, then does a hard navigation via page.goto("/") and expects the theme to persist.
  • This looks timing-dependent: the test does not explicitly wait for the appearance settings update API call to be persisted server-side before the hard navigation.
  • If the navigation happens before the preference is saved, the reload can embed the old theme preference (often defaulting to dark), causing the final assertion to fail.
  • Suggested stabilization: wait for the appearance update request to complete (e.g. page.waitForResponse for the update endpoint) before page.goto("/"), or otherwise wait until persistence is confirmed.

Assignment reasoning:

  • This appears to be an e2e test stability issue; assigning to the e2e flake owner based on existing e2e flake triage patterns in coder/internal.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions