Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI flake] cy.origin window test flake #21376

Closed
mjhenkes opened this issue May 6, 2022 · 5 comments
Closed

[CI flake] cy.origin window test flake #21376

mjhenkes opened this issue May 6, 2022 · 5 comments
Assignees
Labels
CI General issues involving running in a CI provider topic: cy.origin Problems or enhancements related to cy.origin command

Comments

@mjhenkes
Copy link
Member

mjhenkes commented May 6, 2022

Current behavior

Six tests timed out in the cy.origin window tests

CypressError: Timed out after waiting `60000ms` for your remote page to load on origin(s):

- `http://foobar.com:3500`

A cross-origin request for `http://www.foobar.com:3500/fixtures/dom.html` was detected.

A command that triggers cross-origin navigation must be immediately followed by a `cy.origin()` command:

`cy.origin('http://foobar.com:3500', () => {`
`  <commands targeting http://www.foobar.com:3500 go here>`
`})`

If the cross-origin request was an intermediary state, you can try increasing the `pageLoadTimeout` value in `cypress.json` to wait longer.

Browsers will not fire the `load` event until all stylesheets and scripts are done downloading.

When this `load` event occurs, Cypress will continue running commands.
    at timedOutWaitingForPageLoad (cypress:///../driver/src/cy/commands/navigation.ts:84:72)
    at eval (cypress:///../driver/src/cy/commands/navigation.ts:493:16)
    at tryCatcher (cypress:////root/cypress/node_modules/bluebird/js/release/util.js:16:23)
    at eval (cypress:////root/cypress/node_modules/bluebird/js/release/catch_filter.js:17:41)
    at tryCatcher (cypress:////root/cypress/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (cypress:////root/cypress/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (cypress:////root/cypress/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (cypress:////root/cypress/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (cypress:////root/cypress/node_modules/bluebird/js/release/promise.js:690:18)
    at _drainQueueStep (cypress:////root/cypress/node_modules/bluebird/js/release/async.js:138:12)
    at _drainQueue (cypress:////root/cypress/node_modules/bluebird/js/release/async.js:131:9)
    at Async._drainQueues (cypress:////root/cypress/node_modules/bluebird/js/release/async.js:147:5)
    at Async.drainQueues (cypress:////root/cypress/node_modules/bluebird/js/release/async.js:17:14)
From Your Spec Code:
    at Context.eval (http://localhost:3500/__cypress/tests?p=cypress/integration/e2e/multi-domain/commands/multi_domain_window.spec.ts:107:8)

The tests that flaked were:

  • cy.origin window .window()
  • cy.origin window .document()
  • cy.origin window .title()
  • cy.origin window #consoleProps .window()
  • cy.origin window #consoleProps .document()
  • cy.origin window #consoleProps .title()

Desired behavior

Tests run reliably.

Test code to reproduce

See: https://app.circleci.com/pipelines/github/cypress-io/cypress/36903/workflows/c8342f8f-3389-4af5-8a2a-0e09f5ff37ba/jobs/1481372

Cypress Version

9.6.0

Other

No response

@mjhenkes mjhenkes added topic: flake ❄️ topic: cy.origin Problems or enhancements related to cy.origin command labels May 6, 2022
@mjhenkes mjhenkes added this to the 11.0 milestone May 6, 2022
@mjhenkes mjhenkes added the CI General issues involving running in a CI provider label May 6, 2022
@mjhenkes mjhenkes assigned mjhenkes and unassigned AtofStryker May 17, 2022
@mrkjdy
Copy link

mrkjdy commented Jun 3, 2022

I'm having trouble using the cy.origin() command and am facing the same error when trying to login to my companies SSO

cy.origin('login.ibm.com', () => {
  cy.visit('/') // <- hangs here saying the page never fired its 'load' event
    .get('#username') // never gets called
    // ...
});

The same visit does not hang when used outside of an origin block. Should I open a different issue for this?

@idanElitzur
Copy link

Hi @mrkjdy I dealing with the same issue with v10.7.0
Did you manage to solve this out?

@mrkjdy
Copy link

mrkjdy commented Sep 14, 2022

@idanElitzur I opened a different issue #22459

@AtofStryker
Copy link
Contributor

@mjhenkes do we know if the flake issues were fixed with #23297?

@mjhenkes
Copy link
Member Author

These appear to have been fixed by #23297. At a minimum they cannot manifest in the same way anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI General issues involving running in a CI provider topic: cy.origin Problems or enhancements related to cy.origin command
Projects
None yet
Development

No branches or pull requests

4 participants