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:
- CI resource contention: GitHub Actions runners can have variable performance, causing slow library asset loading
- Costume library JSON loading: The library fetches a large JSON asset and multiple SVG thumbnails, which may stall under load
- Selenium WebDriver timing:
clickText('Abby-a') may not reliably wait for the element to be interactive after search filtering
Suggested Fixes
- Increase the test timeout to 90-120 seconds (simple mitigation)
- Add explicit
waitForLoadingFinished() after opening the library modal and after typing the search query
- Use
waitUntil with a custom condition instead of clickText for more reliable element detection
File
packages/scratch-gui/test/integration/costumes.test.js:34
Description
The integration test
costumes.test.js > Working with costumes > Adding a costume through the libraryintermittently fails with a 60-second timeout in CI.Observed Behavior
Error:
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:
clickText('Abby-a')may not reliably wait for the element to be interactive after search filteringSuggested Fixes
waitForLoadingFinished()after opening the library modal and after typing the search querywaitUntilwith a custom condition instead ofclickTextfor more reliable element detectionFile
packages/scratch-gui/test/integration/costumes.test.js:34