Skip to content

fix: flaky e2e alert test#9172

Open
royendo wants to merge 5 commits intomainfrom
royendo/fix-flaky-alert-e2e-notification
Open

fix: flaky e2e alert test#9172
royendo wants to merge 5 commits intomainfrom
royendo/fix-flaky-alert-e2e-notification

Conversation

@royendo
Copy link
Copy Markdown
Contributor

@royendo royendo commented Apr 2, 2026

  • await queryClient.invalidateQueries(...) was blocking the form close and notification toast until the list resources query refetched
  • In CI, this total wait (mutation + refetch) could exceed Playwright's 5s assertion timeout, causing the "Should create alert with schedule" e2e test to flake
  • Changed to void (fire-and-forget) so the notification appears immediately after the mutation succeeds; the cache still invalidates in the background

Flaky test: https://github.com/rilldata/rill/actions/runs/23904454966/job/69720769909

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

Developed in collaboration with Claude Code

…rt creation

The `await` on `queryClient.invalidateQueries` was blocking the form
close and notification toast until the list resources query refetched.
In CI, this could exceed Playwright's 5s assertion timeout, causing
the "Should create alert with schedule" e2e test to flake.

Changed to fire-and-forget (`void`) so the notification appears
immediately after the mutation succeeds. The cache still invalidates
in the background, and page navigations trigger fresh fetches anyway.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@royendo royendo requested a review from AdityaHegde April 2, 2026 19:19
@royendo
Copy link
Copy Markdown
Contributor Author

royendo commented Apr 2, 2026

oh the irony of getting flaky e2e tests when trying to fix a flaky e2e test

@royendo royendo changed the title fix: don't block notification on invalidateQueries after alert/report creation fix: flaky e2e alert test Apr 2, 2026
@AdityaHegde
Copy link
Copy Markdown
Collaborator

Looks like a rerun failed the tests.

I am seeing console errors about submit (we do use use:enhance),

use:enhance must be added to the form to use submit, or pass a HTMLElement inside the form (or the form itself) as an argument

I think the solution would be to make the form creation not be reactive. We would need to re-mount the component every time it is opened. Needs some testing to make sure we update the fields if explore changes.

royendo and others added 4 commits April 3, 2026 09:40
…ce breakage

superForm() was inside a $: reactive block, causing it to be recreated
whenever its dependencies changed. Since use:enhance only binds on mount,
the new instance's enhance never got applied to the DOM, making form
submission unreliable (especially under CI timing).

Initialize superForm once when initialValues becomes available, using
proper SuperForm<T> types instead of any. Guard the template until init
completes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants