Skip to content

Plugin E2E: Select MultiSelect options sequentially#2626

Merged
mckn merged 1 commit into
mainfrom
mckn/fix-playwright-promise-all
May 12, 2026
Merged

Plugin E2E: Select MultiSelect options sequentially#2626
mckn merged 1 commit into
mainfrom
mckn/fix-playwright-promise-all

Conversation

@mckn
Copy link
Copy Markdown
Collaborator

@mckn mckn commented May 12, 2026

What this PR does / why we need it:

Replaces Promise.all(values.map(...)) with a sequential for...of loop in MultiSelect.selectOptions. Playwright interactions on the same UI element are not safe to run concurrently — racing clicks against the same open menu can cause flaky tests because the DOM mutates after each selection. The sequential approach ensures each option is fully selected before the next begins.

Which issue(s) this PR fixes:

Fixes a potential source of flaky tests flagged in #2621 (comment)

Special notes for your reviewer:

The behavior is unchanged — same options are selected in the same order, just awaited one at a time instead of concurrently.

📦 Published PR as canary version: Canary Versions

✨ Test out this PR locally via:

npm install @grafana/plugin-e2e@3.7.2-canary.2626.25732312320.0
npm install @grafana/sign-plugin@3.2.2-canary.2626.25732312320.0
# or 
yarn add @grafana/plugin-e2e@3.7.2-canary.2626.25732312320.0
yarn add @grafana/sign-plugin@3.2.2-canary.2626.25732312320.0

Copilot AI review requested due to automatic review settings May 12, 2026 07:06
@mckn mckn requested a review from a team as a code owner May 12, 2026 07:06
@mckn mckn requested a review from leventebalogh May 12, 2026 07:06
@cla-assistant
Copy link
Copy Markdown

cla-assistant Bot commented May 12, 2026

CLA assistant check
All committers have signed the CLA.

@mckn mckn requested a review from sunker May 12, 2026 07:06
@mckn mckn self-assigned this May 12, 2026
@mckn mckn added the patch Increment the patch version when merged label May 12, 2026
@mckn mckn moved this from 📬 Triage to 🔬 In review in Grafana Catalog Team May 12, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces flakiness in @grafana/plugin-e2e component interactions by making MultiSelect.selectOptions select values sequentially instead of concurrently, avoiding Playwright races against the same open menu element.

Changes:

  • Replaced concurrent Promise.all(values.map(...)) selection with a sequential for...of loop.
  • Preserved the API contract by still returning the selected option text values as a string[].

@sunker sunker added the release Create a release when this pr is merged label May 12, 2026
@mckn mckn force-pushed the mckn/fix-playwright-promise-all branch from d329227 to 2de5a4a Compare May 12, 2026 07:54
@mckn mckn closed this May 12, 2026
@github-project-automation github-project-automation Bot moved this from 🔬 In review to 🚀 Shipped in Grafana Catalog Team May 12, 2026
@mckn mckn reopened this May 12, 2026
@github-project-automation github-project-automation Bot moved this from 🚀 Shipped to 💡 Ideation in Grafana Catalog Team May 12, 2026
…rently

Replace Promise.all with a for...of loop in MultiSelect.selectOptions to
avoid racing concurrent Playwright clicks on the same open menu.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mckn mckn force-pushed the mckn/fix-playwright-promise-all branch from 2de5a4a to b5756ca Compare May 12, 2026 11:45
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

Hello! 👋 This repository uses Auto for releasing packages using PR labels.

✨ This PR can be merged and will trigger a new patch release.
NOTE: When merging a PR with the release label please avoid merging another PR. For further information see here.

Copy link
Copy Markdown
Contributor

@sunker sunker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-project-automation github-project-automation Bot moved this from 💡 Ideation to 🔬 In review in Grafana Catalog Team May 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Playwright test results

Image Name Version Result Report
grafana-enterprise nightly
grafana-enterprise dev-preview-react19
grafana-enterprise 13.0.1
grafana-enterprise 12.1.10
grafana-enterprise 11.0.11
grafana-enterprise 9.3.16
grafana-enterprise 8.5.27
Troubleshooting

404 when clicking on View report

By default, the deploy-report-pages Action deploys reports to the gh-pages branch. However, you need to take an extra step to ensure that GitHub Pages can build and serve the site from this branch. To do so:

  1. Go to the Settings tab of your repository.
  2. In the left-hand sidebar, click on Pages.
  3. Under Source, select Deploy from a branch, then choose the gh-pages branch.

This action needs to be completed manually in order for your GitHub Pages site to be built and accessible from the gh-pages branch. Once configured, GitHub will automatically build and serve the site whenever new reports are deployed.

@mckn mckn merged commit c62528f into main May 12, 2026
47 of 49 checks passed
@mckn mckn deleted the mckn/fix-playwright-promise-all branch May 12, 2026 15:32
@github-project-automation github-project-automation Bot moved this from 🔬 In review to 🚀 Shipped in Grafana Catalog Team May 12, 2026
@grafana-plugins-platform-bot
Copy link
Copy Markdown
Contributor

🚀 PR was released in @grafana/plugin-e2e@3.7.2, @grafana/sign-plugin@3.2.2 🚀

@grafana-plugins-platform-bot grafana-plugins-platform-bot Bot added the released This issue/pull request has been released. label May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Increment the patch version when merged release Create a release when this pr is merged released This issue/pull request has been released.

Projects

Status: 🚀 Shipped

Development

Successfully merging this pull request may close these issues.

3 participants