You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Test flake: create instance with additional disks in safari #2694
That field will only update on blur right? Wonder if we still get the flake if we add something to move focus out of the field, allow it to update and then run the toHaveValue.
Edit: Is is possible that submitting the form happens so quickly it also does so before it can update?
2) [safari] › test/e2e/instance-create.e2e.ts:538:1 › create instance with additional disks ──────
Error: expect(received).toEqual(expected) // deep equality
Expected: ArrayContaining [ObjectContaining {"Name": "new-disk-1", "Size": "5GiB", "Type": "create"}]
Received: [{"Name": "new-disk-1", "Size": "10GiB", "Type": "create"}]
Call Log:
- Timeout 10000ms exceeded while waiting on the predicate
at utils.ts:107
105 | // wait up to 5s for the row to be there
106 | // https://playwright.dev/docs/test-assertions#polling
> 107 | await expect
| ^
108 | // poll slowly because getRows is slow. usually under 200ms but still
109 | .poll(getRows, { intervals: [500] })
110 | .toEqual(expect.arrayContaining([expect.objectContaining(expectedRow)]))
at expectRowVisible (/Users/david/oxide/console/test/e2e/utils.ts:107:3)
at /Users/david/oxide/console/test/e2e/instance-create.e2e.ts:568:3
We're changing that field to 5, but somehow it's flipping back to 10 by the time we submit? I suspect things are just happening too fast and a very short sleep before submit would fix it.
Ok, well this is highly informative. When I add a 300ms sleep after the fill but before the check that the field has the 5 we entered, it fails almost every time. When I add a shorter sleep, it fails less often, and when I add a longer sleep it fails 100% of the time.
So it's the opposite of what I pictured: rather than failing when it's too fast, it only passes when it's fast enough. It fails when it's a little slower. This is consistent with the higher likelihood of failure in CI, which is generally slower than local.
When I add the sleep before the field fill, it passes every time. No flakes!
Activity
david-crespo commentedon Mar 12, 2025
Seeing this one a lot now. It's the only flake we're seeing consistently.
https://github.com/oxidecomputer/console/actions/runs/13800679236/job/38602321597
benjaminleonard commentedon Mar 12, 2025
That field will only update on blur right? Wonder if we still get the flake if we add something to move focus out of the field, allow it to update and then run the
toHaveValue.Edit: Is is possible that submitting the form happens so quickly it also does so before it can update?
david-crespo commentedon Mar 12, 2025
I can get an occasional failure locally with this. It fails a few lines lower, but I think it's for the same reason.
We're changing that field to 5, but somehow it's flipping back to 10 by the time we submit? I suspect things are just happening too fast and a very short sleep before submit would fix it.
2025-03-12-safari-flake.mp4
david-crespo commentedon Mar 12, 2025
Ok, well this is highly informative. When I add a 300ms sleep after the fill but before the check that the field has the 5 we entered, it fails almost every time. When I add a shorter sleep, it fails less often, and when I add a longer sleep it fails 100% of the time.
const sizeField = createForm.getByRole('textbox', { name: 'Size (GiB)' }) await sizeField.fill('5') + await sleep(500) await expect(sizeField).toHaveValue('5') await createForm.getByRole('button', { name: 'Create disk' }).click()So it's the opposite of what I pictured: rather than failing when it's too fast, it only passes when it's fast enough. It fails when it's a little slower. This is consistent with the higher likelihood of failure in CI, which is generally slower than local.
When I add the sleep before the field fill, it passes every time. No flakes!
const sizeField = createForm.getByRole('textbox', { name: 'Size (GiB)' }) + await sleep(1000) await sizeField.fill('5') await expect(sizeField).toHaveValue('5') await createForm.getByRole('button', { name: 'Create disk' }).click()That is an immediate fix, but I'm spending a few minutes looking at what this form does on initial render that could be causing this.