Bug #23180
closedWorkbench collection test "renames a file to a different directory" is flaky
Description
It can fail like this:
Running: collection.cy.js (4 of 25)
Collection panel tests
✓ allows to download mountain duck config for a collection (6189ms)
✓ attempts to use a preexisting name creating or updating a collection (10020ms)
✓ uses the property editor (from edit dialog) with vocabulary terms (4634ms)
✓ uses the editor (from details panel) with vocabulary terms (6536ms)
✓ shows collection by URL (12934ms)
✓ renames a file using valid names (72090ms)
1) renames a file to a different directory
✓ shows collection owner (7171ms)
✓ tries to rename a file with illegal names (10471ms)
✓ can correctly display old versions (3428ms)
✓ views & edits storage classes data (4965ms)
✓ moves a collection to a different project (9416ms)
✓ automatically updates the collection UI contents without using the Refresh button (4964ms)
✓ makes a copy of an existing collection (12240ms)
✓ uses the collection version browser to view a previous version (19001ms)
✓ copies selected files into new collection (10079ms)
✓ copies selected files into existing collection (13779ms)
✓ copies selected files into separate collections (15854ms)
✓ moves selected files into new collection (10330ms)
✓ moves selected files into existing collection (11450ms)
✓ moves selected files into separate collections (17536ms)
✓ creates new collection with properties on home project (10458ms)
✓ shows responsible person for collection if available (4004ms)
file upload
✓ uploads a file and checks the collection UI to be fresh (12883ms)
✓ uploads and maintains nested folder structure (7277ms)
✓ allows to cancel running upload (5233ms)
✓ allows to cancel single file from the running upload (6120ms)
✓ allows to cancel all files from the running upload (9020ms)
✓ displays the correct breadcrumbs after moving a collection to trash (13877ms)
zip download
✓ all files (7235ms)
✓ one file (8713ms)
✓ multi file (9892ms)
31 passing (7m)
1 failing
1) Collection panel tests
renames a file to a different directory:
AssertionError: Timed out retrying after 4000ms: Expected <form> not to exist in the DOM, but it was continuously found.
at eval (webpack://arvados-workbench-2/./cypress/e2e/collection.cy.js:439:52)
at Array.forEach (<anonymous>)
at Context.eval (webpack://arvados-workbench-2/./cypress/e2e/collection.cy.js:413:65)
(Results)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Tests: 32 │
│ Passing: 31 │
│ Failing: 1 │
│ Pending: 0 │
│ Skipped: 0 │
│ Screenshots: 1 │
│ Video: false │
│ Duration: 6 minutes, 32 seconds │
│ Spec Ran: collection.cy.js │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
Full log attached.
Files
Updated by Brett Smith 6 months ago
I've only spot-checked a few of these, but in every one I've checked, this test is the cause of the failure. Fixing this is pressing.

Updated by Brett Smith 6 months ago
- Target version set to Development 2025-10-15
Updated by Lisa Knox 6 months ago
21380-collection-test @ cc08efbdbbd9534fd1038fd6dd77ee39785c9f69
developer-run-tests-services-workbench2: #1641
run-tests-services-workbench2-integration: #807
run-tests-services-workbench2-integration: #808
run-tests-services-workbench2-integration: #809
run-tests-services-workbench2-integration: #810
run-tests-services-workbench2-integration: #811
- ✅ All agreed upon points are implemented / addressed.
- ✅ Anything not implemented (discovered or discussed during work) has a follow-up story.
- ✅ Code is tested and passing, both automated and manual, what manual testing was done is described
- ✅ The tested code incorporates recent main branch changes.
- n//a New or changed UX/UX and has gotten feedback from stakeholders.
- n/a Documentation has been updated.
- ✅ Behaves appropriately at the intended scale (describe intended scale).
- ✅ Considered backwards and forwards compatibility issues between client and server.
- ✅ Follows our coding standards and GUI style guidelines.
- The failures in the collection test were due to the CLOSE_DIALOG function only being called on the happy path of the renameFile function, i.e. when all necessary values are populated. If any of the values were undefined, the dialog would never close, which caused the test to fail.
- renameFile now calls CLOSE_DIALOG no matter what.
- This revealed that in situations where any of the necessary values did not populate, the opening of the context menu in the next part of the test would fail and cause a nasty error overlay. This is because the type for the item passed to the openContextMenu function was types as
any, and therefore null values were never accounted for.- The function that calls openContextMenu now uses a proper type that includes undefined, and the openContextMenu now handles null values.
- This revealed that in these situations, the collection files menu takes maybe 6-10 seconds to load when switching directories after renaming one of them in the test environment. I was unable to reproduce this locally or on Tordo or Pirca, and since it's never been reported anywhere, I'm going to assume (for now) that it's unique to the test environment.
- Added a more accurate check that the DOM has finished loading with a 20-second timeout.
Updated by Lisa Knox 5 months ago
- Related to Bug #23199: Context menu doesn't open on directories with open files in the collection files viewer added
Updated by Lisa Knox 5 months ago
Renamed and squashed branch:
23180-collection-test-2 @ 54065091b68f99244ac0dd0e6bee4e5e5c1389b8
Updated by Stephen Smith 5 months ago
Just 1 nit, the || false in collection-panel-files-actions.ts and collection-panel-files.ts seems unnecessary, since it's an equality and not boolean algebra there shouldn't be a risk that a non-boolean falsy value needs to be caught with || false
Updated by Lisa Knox 5 months ago
23180-collection-test-2 @ 3a605f35a99fc6f911a49ba9fb4c0496428271f3
developer-run-tests-services-workbench2: #1644
Removed. Also removed stray 'Process' import that snuck in from main.
Updated by Lisa Knox 5 months ago
- Status changed from In Progress to Resolved
Applied in changeset arvados|740cf51196f45db2dd6d985f7f5ff0f6482bb828.