Changes at arvados|96ee758154b80bd4f2a12b743e1022e8f60d03cb branch 21353-loginas-flaky-bug
Tests: developer-run-tests-services-workbench2: #414 
As far as my investigation went, I found that window.location would be undefined ~10% of the time. This caused cy.url
(which is an alias to cy.location('href')
) to index off of undefined, and cy.location()
itself would be undefined, which led to non-retryability both when asserting with cy.url and cy.location. Moving the loginAs into the .then body of createContainerRequest to make the test match others also somehow made no difference.
In order to get around window.location sometimes being undefined, I added the cypress-wait-until plugin in order to wait for cy.location to not be undefined - since the whole cy.location is wrapped in waitUntil and there are no asserts, just vanilla comparisons, waitUntil is able to retry and not permafail when window.location is undefined. I also moved the url check for /projects/
into waitUntil since it also seemed that window.location could be defined then undefined again, and that ensures it waits until the url is ready.
It also seemed to need a couple waitForDoms, one before checking for Arvados Workbench
in loginAs since it seemed to be unable to get the element and failed immediately, and another in process spec after navigating to the process view.
With these changes it seems to be completely reliable now, passing 60 runs without flaking.
- Added cypress-wait-until to wait for window.location to be defined and to replace check for
/projects/
in url
- Add waitForDom in loginAs and process spec