Skip to content

test(NcFilePicker): fix flaky tests#8619

Merged
odzhychko merged 1 commit into
nextcloud-libraries:mainfrom
odzhychko:flaky-NcFilePicker-tests
Jun 22, 2026
Merged

test(NcFilePicker): fix flaky tests#8619
odzhychko merged 1 commit into
nextcloud-libraries:mainfrom
odzhychko:flaky-NcFilePicker-tests

Conversation

@odzhychko

@odzhychko odzhychko commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

☑️ Resolves

Resolves flaky test that occurred locally for me and sometimes on CI. The issue was a race condition.

  1) [chromium] › tests/component/components/NcFilePicker/NcFilePicker.spec.ts:132:2 › file picking › picking multiple files 

    Error: fileChooser.setFiles: Test ended.

      133 |             page.on('filechooser', async (fileChooser) => {
      134 |                     expect(fileChooser.isMultiple()).toBe(true)
    > 135 |                     await fileChooser.setFiles([
          |                     ^
      136 |                             { name: 'a.txt', mimeType: 'text/plain', buffer: Buffer.from('Hello') },
      137 |                             { name: 'b.txt', mimeType: 'text/plain', buffer: Buffer.from('Hallo') },
      138 |                             { name: 'c.txt', mimeType: 'text/plain', buffer: Buffer.from('Hola') },
        at _Page.<anonymous> (/workspaces/nextcloud-vue/tests/component/components/NcFilePicker/NcFilePicker.spec.ts:135:4)

    Error Context: test-results/components-NcFilePicker-Nc-6015b-king-picking-multiple-files-chromium/error-context.md
      14) [firefox] › tests/component/components/NcFilePicker/NcFilePicker.spec.ts:112:2 › file picking › picking a single file 

    Error: fileChooser.setFiles: Test ended.

      113 |             page.on('filechooser', async (fileChooser) => {
      114 |                     expect(fileChooser.isMultiple()).toBe(false)
    > 115 |                     await fileChooser.setFiles({ name: 'testfile.txt', mimeType: 'text/plain', buffer: Buffer.from('Hello World') })
          |                     ^
      116 |             })
      117 |
      118 |             const { promise, resolve } = Promise.withResolvers<string[]>()
        at _Page.<anonymous> (/workspaces/nextcloud-vue/tests/component/components/NcFilePicker/NcFilePicker.spec.ts:115:4)

    Error Context: test-results/components-NcFilePicker-Nc-afac6-cking-picking-a-single-file-firefox-repeat1/error-context.md

🖼️ Screenshots

🚧 Tasks

🏁 Checklist

  • ⛑️ Tests are included or are not applicable
  • 📘 Component documentation has been extended, updated or is not applicable
  • 2️⃣ Backport to stable8 for maintained Vue 2 version or not applicable
    • stable8 does not use Playwright

Info

Locally, you could observe failing test by running them repeatably:

npm run test:component -- NcFilePicker.spec.ts --repeat-each=10

Changed because of flakiness:
  - `picking a single file`
  - `picking multiple files`

The rest were change for consistency.

Signed-off-by: Oleksandr Dzhychko <hey@oleks.dev>
@odzhychko
odzhychko force-pushed the flaky-NcFilePicker-tests branch from b1fffc2 to c60d7ba Compare June 8, 2026 18:15
@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.05%. Comparing base (9e6b6b9) to head (c60d7ba).
⚠️ Report is 53 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8619   +/-   ##
=======================================
  Coverage   54.05%   54.05%           
=======================================
  Files         106      106           
  Lines        3478     3478           
  Branches     1007     1008    +1     
=======================================
  Hits         1880     1880           
  Misses       1354     1354           
  Partials      244      244           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@GVodyanov GVodyanov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

@odzhychko
odzhychko enabled auto-merge June 16, 2026 09:49
@susnux

susnux commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

@odzhychko please always add the appropriate labels and milestones.

@susnux susnux added 3. to review Waiting for reviews refactor ♻️ Pull request that is neither a fix nor a feature labels Jun 22, 2026
@susnux susnux added this to the 9.8.3 milestone Jun 22, 2026
@odzhychko
odzhychko merged commit f64415e into nextcloud-libraries:main Jun 22, 2026
24 checks passed
@susnux susnux modified the milestones: 9.8.3, 9.9.0 Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews refactor ♻️ Pull request that is neither a fix nor a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants