coder / coder

Provision remote development environments via Terraform
https://coder.com
GNU Affero General Public License v3.0
7.9k stars 661 forks source link

flake: `UsersPage.test.tsx` #14535

Closed dannykopping closed 8 hours ago

dannykopping commented 2 weeks ago

https://github.com/coder/coder/actions/runs/10680634527/job/29602816185

FAIL src/pages/UsersPage/UsersPage.test.tsx (19.402 s)
  ● UsersPage › suspend user › when it is success › shows a success message

...
      24 |  const user = userEvent.setup();
      25 |  // Get the first user in the table
    > 26 |  const moreButtons = await screen.findAllByLabelText("More options");
         |                                   ^
      27 |  const firstMoreButton = moreButtons[0];
      28 |  await user.click(firstMoreButton);
      29 |

      at waitForWrapper (node_modules/.pnpm/@testing-library+dom@9.3.3/node_modules/@testing-library/dom/dist/wait-for.js:162:27)
      at node_modules/.pnpm/@testing-library+dom@9.3.3/node_modules/@testing-library/dom/dist/query-helpers.js:86:31
      at findAllByLabelText (src/pages/UsersPage/UsersPage.test.tsx:26:35)
      at Object.suspendUser (src/pages/UsersPage/UsersPage.test.tsx:141:11)
BrunoQuaresma commented 1 week ago

Another failing job just for the record https://github.com/coder/coder/actions/runs/10706938607/job/29685833175?pr=14564

DanielleMaywood commented 1 week ago

Just had 3 in a row:

Parkreiner commented 1 week ago

Yeah, just had this trigger for me, too, even though none of my changes affected the users page https://github.com/coder/coder/actions/runs/10723982103/job/29738578173?pr=14547#logs

The selector itself looks right. The accessibility tree has the label, and it's also using that as its accessible name, so the choice of selecting by name or by label shouldn't matter. findBy selectors should also work fine with our conditional rendering

Preview of accessibility tree for MoreButton

It's gotta be strictly a mock data loading error

Parkreiner commented 1 week ago

I'm so sorry, Bruno, but it's back https://github.com/coder/coder/actions/runs/10786037607/job/29912253809?pr=14629#logs

BrunoQuaresma commented 1 week ago

@Parkreiner is it updated with main? Because I literally removed the test file https://github.com/coder/coder/pull/14579/files#diff-1dbaa705844a001ee47037bae756983ca35300457ea2d362c535c81acc0aee54

BrunoQuaresma commented 1 week ago

Looks like it's not. I checked, and UsersPage.test.tsx does not exist on main anymore. Please close the issue again if the test passes after you update the branch with the current main. 🙏