Skip to content

Conversation

@christian-byrne
Copy link
Contributor

@christian-byrne christian-byrne commented May 30, 2025

Fixes the deferred timing condition introduced in PR #3955 that was causing multiple Playwright tests to become flaky.

Problem:
PR #3955 refactored file handling by introducing a dynamic import in the handleFile method:

const { getFileHandler } = await import('@/utils/fileHandlers')

Fixes #4029.

┆Issue is synchronized with this Notion page by Unito

Replace dynamic import with static import in handleFile method to eliminate race condition causing Playwright test flakiness.

The dynamic import introduced asynchronous behavior that created timing issues in tests expecting immediate file processing completion.

Fixes #3955 test flakiness
@christian-byrne christian-byrne requested a review from a team as a code owner May 30, 2025 23:55
@christian-byrne
Copy link
Contributor Author

Test report:

Running 337 tests using 2 workers
········°····································°··································
·····°························°·················································
·····································°··········································
······························°°°°°°°°°°°°°°°°°°°°°··················°··········
···········°···×·±

  1) [chromium] › tests/widget.spec.ts:181:3 › Image widget › Can change image by changing the filename combo value 

    Test timeout of [15](https://github.com/Comfy-Org/ComfyUI_frontend/actions/runs/15357823358/job/43220311580?pr=4031#step:7:16)000ms exceeded.

    Error: locator.click: Test timeout of 15000ms exceeded.
    Call log:
      - waiting for getByRole('menuitem', { name: 'image32x32.webp' })


      194 |       name: 'image32x32.webp'
      195 |     })
    > 196 |     await comboEntry.click({ noWaitAfter: true })
          |                      ^
      197 |
      198 |     // Expect the image preview to change automatically
      199 |     await expect(comfyPage.canvas).toHaveScreenshot(

        at /home/runner/work/ComfyUI_frontend/ComfyUI_frontend/ComfyUI_frontend/browser_tests/tests/widget.spec.ts:196:22

  1 flaky
    [chromium] › tests/widget.spec.ts:[18](https://github.com/Comfy-Org/ComfyUI_frontend/actions/runs/15357823358/job/43220311580?pr=4031#step:7:19)1:3 › Image widget › Can change image by changing the filename combo value 
  28 skipped
  308 passed (11.8m)

@christian-byrne christian-byrne changed the title [fix] Remove dynamic import race condition causing Playwright test flakiness [fix] Remove dynamic import timing issue causing Playwright test flakiness May 31, 2025
@webfiltered webfiltered merged commit afac449 into main May 31, 2025
10 checks passed
@webfiltered webfiltered deleted the fix/remove-dynamic-import-race-condition branch May 31, 2025 04:01
webfiltered added a commit that referenced this pull request Jun 1, 2025
lordTyrion pushed a commit to playbook3d/ComfyUI_frontend that referenced this pull request Jul 2, 2025
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.

Test flakiness increase, intermittent failure

3 participants