Skip to content

flake: TemplateVariablesPage user submits the form successfully #1373

@flake-investigator

Description

@flake-investigator

CI Run: https://github.com/coder/coder/actions/runs/22585104030
Failed Job: test-js (ubuntu-latest)
Commit: 7bc454eed8c9efb7502648195dc9967d59e7267a (Steven Masley)

Failure:

FAIL src/pages/TemplateSettingsPage/TemplateVariablesPage/TemplateVariablesPage.jest.tsx
  ● TemplateVariablesPage › user submits the form successfully

    expect(jest.fn()).toHaveBeenCalledWith(...expected)

    Expected: "Template \"test-template\" variables updated successfully."
    Number of calls: 0

    at toHaveBeenCalledWith (src/pages/TemplateSettingsPage/TemplateVariablesPage/TemplateVariablesPage.jest.tsx:107:28)
    at callback (node_modules/@testing-library/dom/dist/config.js:47:12)
    at checkCallback (node_modules/@testing-library/dom/dist/wait-for.js:123:75)

Error Analysis:

  • The success toast spy never fires after clicking Save, so the test times out waiting for toast.success().
  • Appears to be timing/async ordering around updateActiveTemplateVersion completion or toast emission.

Root Cause Classification: Flaky test (toast not emitted / async timing)

Assignment Analysis:

  • git log --oneline -10 --follow site/src/pages/TemplateSettingsPage/TemplateVariablesPage/TemplateVariablesPage.jest.tsx
    • 15a2bab1cd31a3b64844d3feb8b8835c4de3d871 feat: migrate from <GlobalSnackbar /> to sonner (#22258) (author: Jake Howell, GitHub: jakehwll)
  • No newer test-specific commits found; recent toast migration likely affects this expectation.

Suggested Assignee: jakehwll

Duplicate Search:

  • repo:coder/internal is:issue TemplateVariablesPage.jest.tsx
  • repo:coder/internal is:issue "TemplateVariablesPage" "user submits the form successfully"
  • repo:coder/internal is:issue "variables updated successfully" toast
  • repo:coder/internal is:issue is:closed TemplateVariablesPage

Reproduction (if needed):

  • cd site && pnpm test:ci --max-workers "$(nproc)" -- TemplateVariablesPage.jest.tsx

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions