Skip to content

fix: flaky integration test — costumes.test.js timeout on library add #447

@takaokouji

Description

@takaokouji

Description

The integration test costumes.test.js > Working with costumes > Adding a costume through the library intermittently fails with a 60-second timeout in CI.

Observed Behavior

Error:

FAIL test/integration/costumes.test.js (134.832 s)
  ● Working with costumes › Adding a costume through the library

    thrown: "Exceeded timeout of 60000 ms for a test."

      at test (test/integration/costumes.test.js:34:5)

Root Cause Analysis

The test opens the costume library modal, types a search query, clicks a result, and waits for the editor to show the new costume. The 60-second timeout (jest.setTimeout(60_000)) is already set at the top of the file, acknowledging the library is slow to load.

Likely causes:

  1. CI resource contention: GitHub Actions runners can have variable performance, causing slow library asset loading
  2. Costume library JSON loading: The library fetches a large JSON asset and multiple SVG thumbnails, which may stall under load
  3. Selenium WebDriver timing: clickText('Abby-a') may not reliably wait for the element to be interactive after search filtering

Suggested Fixes

  1. Increase the test timeout to 90-120 seconds (simple mitigation)
  2. Add explicit waitForLoadingFinished() after opening the library modal and after typing the search query
  3. Use waitUntil with a custom condition instead of clickText for more reliable element detection

File

packages/scratch-gui/test/integration/costumes.test.js:34

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions