Skip to content

e2e flake: createTemplate #9324

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

Closed
spikecurtis opened this issue Aug 25, 2023 · 6 comments
Closed

e2e flake: createTemplate #9324

spikecurtis opened this issue Aug 25, 2023 · 6 comments
Assignees
Labels
s4 Internal bugs (e.g. test flakes), extreme edge cases, and bug risks

Comments

@spikecurtis
Copy link
Contributor

https://github.com/coder/coder/actions/runs/5963355777/job/16176395702

       at helpers.ts:164

      162 |   await page.getByLabel("Name *").fill(name)
      163 |   await page.getByTestId("form-submit").click()
    > 164 |   await expect(page).toHaveURL("/templates/" + name, {
          |                      ^
      165 |     timeout: 30000,
      166 |   })
      167 |   return name

        at createTemplate (/home/runner/actions-runner/_work/coder/coder/site/e2e/helpers.ts:164:22)
        at /home/runner/actions-runner/_work/coder/coder/site/e2e/tests/createWorkspace.spec.ts:106:20

    attachment #1: video (video/webm) ──────────────────────────────────────────────────────────────
    test-results/tests-createWorkspace-create-workspace-and-overwrite-default-parameters-tests/video.webm
    ────────────────────────────────────────────────────────────────────────────────────────────────
video.webm

From the video, it looks like the "Create Template" button isn't getting clicked, or maybe clicked before something is ready.

@BrunoQuaresma
Copy link
Collaborator

There is no way to scroll down to the top? My guess is, that there is some validation error that is preventing it from being submitted and I guess it is because the template name is already being used. @mtojek what do you think? I think we can generate a name + a random UUID and see if that solves the flake.

@mtojek
Copy link
Member

mtojek commented Aug 25, 2023

There is no way to scroll down to the top?

I guess that we should adjust the window size, or at least increase it 2x.

think we can generate a name + a random UUID and see if that solves the flake.

Templates already have random names:

  const name = randomName()
  await page.getByLabel("Name *").fill(name)
  await page.getByTestId("form-submit").click()

I suspect that the problem might be different, the workspace build is just indefinitely pending. The clue is why, and how we can confirm what is happening behind the scenes. BTW maybe there is a field for improvement to show the status/spinner/something close to the "submit" button?

@BrunoQuaresma
Copy link
Collaborator

BrunoQuaresma commented Aug 25, 2023

@mtojek the button should display a spinner when it is loading - creating the template.

@mtojek
Copy link
Member

mtojek commented Aug 25, 2023

There are some error logs:

[WebServer] 2023-08-24 12:05:51.758 [erro]  coderd: failed to query logs  job_id=8bdf4611-da2b-40e6-8477-b85d95dd821b  request_id=98de5b64-1168-49ff-b290-7c7bc6d48cdf ...
    error= error writing to websocket:
               github.com/coder/coder/v2/coderd.(*logFollower).query
                   /home/runner/actions-runner/_work/coder/coder/coderd/provisionerjobs.go:459
             - failed to write msg: failed to close writer: failed to write fin frame: failed to write frame: WebSocket closed: failed to acquire lock: context deadline exceeded
2023/08/24 12:05:51 websocket: failed to marshal close frame: reason string max is 123 but got "error writing to websocket: failed to write msg: failed to close writer: failed to write fin frame: failed to write frame: WebSocket closed: failed to acquire lock: context deadline exceeded" with length 190
2023-08-24 12:05:51.758 [warn]  coderd: failed to close webscoket  job_id=8bdf4611-da2b-40e6-8477-b85d95dd821b  request_id=98de5b64-1168-49ff-b290-7c7bc6d48cdf  error="failed to close WebSocket: failed to marshal close frame: reason string max is 123 but got \"error writing to websocket: failed to write msg: failed to close writer: failed to write fin frame: failed to write frame: WebSocket closed: failed to acquire lock: context deadline exceeded\" with length 190"
2023-08-24 12:05:51.758 [info]  echo: recv done on Session  session_id=ebfe2d8c-b79e-4704-b80b-d9129b9e78f8  error=EOF
[WebServer] 2023/08/24 12:05:51 websocket: failed to marshal close frame: reason string max is 123 but got "failed to ping: WebSocket closed: failed to read frame header: read tcp 127.0.0.1:3000->127.0.0.1:55878: read: connection reset by peer" with length 135
[WebServer] 2023-08-24 12:05:51.841 [warn]  coderd: tailnet coordinator agent error  request_id=480db43d-0b24-4e97-85b5-b3d295624245 ...
    error= handle next agent message:
               github.com/coder/coder/v2/tailnet.(*coordinator).ServeAgent
                   /home/runner/actions-runner/_work/coder/coder/tailnet/coordinator.go:468
             - read json:
               github.com/coder/coder/v2/tailnet.(*coordinator).handleNextAgentMessage
                   /home/runner/actions-runner/_work/coder/coder/tailnet/coordinator.go:552
             - failed to get reader: failed to read frame header: read tcp 127.0.0.1:3000->127.0.0.1:55880: read: connection reset by peer
2023/08/24 12:05:51 websocket: failed to marshal close frame: reason string max is 123 but got "handle next agent message: read json: failed to get reader: failed to read frame header: read tcp 127.0.0.1:3000->127.0.0.1:55880: read: connection reset by peer" with length 161

I'm wondering if it is possible to record the video with a bigger viewport and dev console to show network traffic.

@kylecarbs
Copy link
Member

I'm not exactly sure why the attached commit would result in this fixing the problem, because the error appears to be the provisioner timing out? But the FE was hanging waiting for logs, so we should see some change.

kylecarbs added a commit that referenced this issue Aug 27, 2023
@matifali matifali added bug s4 Internal bugs (e.g. test flakes), extreme edge cases, and bug risks and removed chore labels Aug 30, 2023
@mtojek
Copy link
Member

mtojek commented Sep 1, 2023

Most likely the provisioner is timing out due to the deadlock in coderd.

Duplicate of #9426

@mtojek mtojek closed this as completed Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s4 Internal bugs (e.g. test flakes), extreme edge cases, and bug risks
Projects
None yet
Development

No branches or pull requests

5 participants