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

Multi-user feature UI integration tests are unstable. #377

Closed
ximon18 opened this issue Jan 13, 2021 · 6 comments
Closed

Multi-user feature UI integration tests are unstable. #377

ximon18 opened this issue Jan 13, 2021 · 6 comments
Assignees

Comments

@ximon18
Copy link
Member

ximon18 commented Jan 13, 2021

Note: This relates to the multi-user feature in the v0.8.1-bis branch.

The test in multi_user_config_file_with_ta.js sometimes fails with:

AssertionError: Timed out retrying after 4000ms: Expected to find element: `Click here to refresh`, but never found it.

I suspect that the test needs to wait for Krill to issue the resources and for them to appear in the UI.

@ximon18 ximon18 added this to To Do in Release 0.9.0 Jan 13, 2021
ximon18 added a commit that referenced this issue Jan 14, 2021
…Actions creates the new coverage workflow.
@ximon18 ximon18 changed the title Multi-user feature UI integration test 'Add ROA for CA ca_admin as admin user should succeed' is flakey Multi-user feature UI integration test 'Add ROA for CA ...' is flakey Jan 15, 2021
ximon18 added a commit that referenced this issue Jan 15, 2021
… (#372)

Trigger a new code coverage report GitHub Actions CI workflow after successful completion of the CI workflow (#371).
Also attempts to stablize the flakey add ROAs UI test (#377).
@ximon18
Copy link
Member Author

ximon18 commented Jan 15, 2021

Unfortunately the test is now failing either more often or every time, so the attempt to fix it needs more work.

Config File Users with TA
       Add ROA for CA ca_readonly as readonly user should fail:
     CypressError: Timed out retrying after 5000ms: `cy.wait()` timed out waiting `5000ms` for the 1st request to the route: `analyzeRoutes`. No request ever occurred.

@ximon18 ximon18 self-assigned this Jan 15, 2021
@ximon18 ximon18 moved this from To Do to In Progress in Release 0.9.0 Jan 15, 2021
ximon18 added a commit that referenced this issue Jan 15, 2021
As it is causing test failures for other commits/PRs.
@ximon18
Copy link
Member Author

ximon18 commented Jan 15, 2021

Update: the "Add ROA" test does fail but not every time.

@ximon18
Copy link
Member Author

ximon18 commented Jan 15, 2021

Interestingly the same test suite sometimes fails a different way in one of the other tests:

  1) Config File Users with TA
       Register CA ca_readonly with parent as rohelper user should succeed:
     CypressError: The following error originated from your application code, not from Cypress.

  > ResizeObserver loop limit exceeded

When Cypress detects uncaught errors originating from your application it will automatically fail the current test.

This behavior is configurable, and you can choose to turn this off by listening to the `uncaught:exception` event.

https://on.cypress.io/uncaught-exception-from-application
      at cypressErr (https://localhost:3000/__cypress/runner/cypress_runner.js:172812:18)
      at Object.errByPath (https://localhost:3000/__cypress/runner/cypress_runner.js:172863:10)
      at Object.createUncaughtException (https://localhost:3000/__cypress/runner/cypress_runner.js:161554:45)
      at $Cy.onUncaughtException (https://localhost:3000/__cypress/runner/cypress_runner.js:170376:26)
      at onError (https://localhost:3000/__cypress/runner/cypress_runner.js:169436:39)
  From Your Spec Code:
      at Context.eval (https://localhost:3000/__cypress/tests?p=tests/ui/cypress_specs/multi_user_config_file_with_ta.js:398:41)

@ximon18 ximon18 changed the title Multi-user feature UI integration test 'Add ROA for CA ...' is flakey Multi-user feature UI integration tests are unstable. Jan 15, 2021
@ximon18
Copy link
Member Author

ximon18 commented Jan 15, 2021

I'm now aware of at least four test failures that are sometimes occuring:

Test Script Test Name Observed Failure Examples Status
multi_user_config_file_with_ta.js "Add ROA ..." AssertionError: Timed out retrying after 4000ms: Expected to find element: Click here to refresh, but never found it. n/a test disabled
multi_user_config_file_with_ta.js "Add ROA ..." CypressError: Timed out retrying after 5000ms: cy.wait() timed out waiting 5000ms for the 1st request to the route: analyzeRoutes. No request ever occurred. own dev machine investigating
multi_user_config_file_with_ta.js "Register CA ..." ResizeObserver loop limit exceeded *1 example example example example investigating
multi_user_openid_connect.js "Login receives short-lived refreshable token" AssertionError: Timed out retrying after 4000ms: Expected to find element: #userinfo, but never found it. example
multi_user_openid_connect.js "Login receives short-lived that cannot be refreshed" CypressError: Timed out retrying after 5000ms: cy.wait() timed out waiting 5000ms for the 2nd request to the route: isAuthorized. No request ever occurred example fixed by b4c9994
multi_user_config_file.js n/a docker: Error response from daemon: Get https://registry-1.docker.io/v2/cypress/included/manifests/6.2.0: received unexpected HTTP status: 502 Bad Gateway. example new

I can't yet reproduce these locally, presumably because my development machine is faster than the GitHub Actions runner VMs and so the state is as expected rather than not yet having reached the required state.

*1: According to this we should configure cypress to ignore this error. For more information see this as well. Example JS Cypress code that shows how to catch uncaught exceptions can be seen here.

ximon18 added a commit that referenced this issue Jan 17, 2021
…GH Action runner VMs before Krill is able to validate it. (#377)
ximon18 added a commit that referenced this issue Jan 18, 2021
…ceeded" errors using a custom Cypress uncaught exception handler. Unable to reproduce locally or even confirm that the new handler is being invoked. (#377)
ximon18 added a commit that referenced this issue Jan 18, 2021
…ceeded" errors using a custom Cypress uncaught exception handler. Unable to reproduce locally or even confirm that the new handler is being invoked. (file missed from previous commit) (#377)
ximon18 added a commit that referenced this issue Jan 18, 2021
* Use a less short 'short-lived' token that doesn't expire in the GH Action runner VMs before Krill is able to validate it. (#377)
* Attempt to suppress occasional spurious "ResizeObserver loop limit exceeded" errors using a custom Cypress uncaught exception handler. Unable to reproduce locally or even confirm that the new handler is being invoked. (#377)
ximon18 added a commit that referenced this issue Jan 19, 2021
Can I reproduce the unstable tests on a self-hosted runner? (#377)
ximon18 added a commit that referenced this issue Jan 19, 2021
Can I reproduce the unstable tests on a self-hosted runner? (#377)
ximon18 added a commit that referenced this issue Jan 22, 2021
Update the uncaught exception string match to match on the right error property and text.
ximon18 added a commit that referenced this issue Jan 22, 2021
Update the uncaught exception string match to match on the right error property and text.
@ximon18
Copy link
Member Author

ximon18 commented Jan 22, 2021

Update: There have been very few (none?) failures since the ResizeObserver workaround was tuned and the "Add ROAs" test was disabled. The "Add ROAs" test still needs work to make it deterministic however.

ximon18 added a commit that referenced this issue Jan 23, 2021
@ximon18 ximon18 moved this from In Progress to In Review in Release 0.9.0 Jan 23, 2021
ximon18 added a commit that referenced this issue Jan 29, 2021
Wait until CA resources exist before adding a ROA. Synced with Lagosta master branch commit 30215b85. (#377).
@ximon18
Copy link
Member Author

ximon18 commented Jan 29, 2021

Closing as the UI tests in the dev branch have been stable for a week now. Will re-open if another failure occurs.

@ximon18 ximon18 closed this as completed Jan 29, 2021
Release 0.9.0 automation moved this from In Review to Done Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Release 0.9.0
  
Done
Development

No branches or pull requests

1 participant