Michael Miklavcic created METRON-1946:
-----------------------------------------
Summary: Intermittent Cypress test failure
Key: METRON-1946
URL: https://issues.apache.org/jira/browse/METRON-1946
Project: Metron
Issue Type: Bug
Reporter: Michael Miklavcic
There appears to be an intermittent test failure related to Cypress tests. In
this case, we failed on pcap. Here's some further exposition by Shane Ardell
over Slack:
{quote}Shane Ardell
@Michael Miklavcic I took a look at that travis failure. From the error
message, it sounds like a race condition with Cypress running a click command
before the page loads. This is very odd because Cypress should pause command
execution, prevent them from timing out, and then begin re-running them once
the page transition is complete. I think this isn't happening because we are
using Angular's internal routing versus having cypress enter a url for us and
load the page.
All that said, this seems like something that rarely happens (I think this is
the first failure like this in the ~2 months we've been using Cypress). I
merged a PR into master a little bit ago and everything passes. I think I'll
create a ticket for us to default to using Cypress' router while still having
tests in place to ensure Angular's routing works as intended.
{quote}
[https://travis-ci.org/apache/metron/jobs/469797918]
Excerpt of the failed test below:
{code:java}
[INFO] ** Angular Live Development Server is listening on localhost:4200, open
your browser on http://localhost:4200/ **
[INFO] [00:54:14] Verifying Cypress can run
/home/travis/.cache/Cypress/3.1.0/Cypress [completed]
[INFO]
[INFO] Opening Cypress...
[INFO]
7====================================================================================================
[INFO]
[INFO] (Run Starting)
[INFO]
7
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
[INFO] │ Cypress: 3.1.0
│
[INFO] │ Browser: Electron 59 (headless)
│
[INFO] │ Specs: 1 found (pcap/pcap.spec.js)
│
[INFO]
└────────────────────────────────────────────────────────────────────────────────────────────────┘
[INFO]
[INFO]
7[INFO] Date: 2018-12-19T00:54:51.186Z
[INFO] Hash: d1bc9dd2b68c4ce06cfa
[INFO] Time: 36778ms
[INFO] chunk {app-alerts-alerts-list-alerts-list-module-ngfactory}
app-alerts-alerts-list-alerts-list-module-ngfactory.js,
app-alerts-alerts-list-alerts-list-module-ngfactory.js.map
(app-alerts-alerts-list-alerts-list-module-ngfactory) 11.6 kB [rendered]
[INFO] chunk {app-alerts-save-search-save-search-module-ngfactory}
app-alerts-save-search-save-search-module-ngfactory.js,
app-alerts-save-search-save-search-module-ngfactory.js.map
(app-alerts-save-search-save-search-module-ngfactory) 5.7 kB [rendered]
[INFO] chunk {app-alerts-saved-searches-saved-searches-module-ngfactory}
app-alerts-saved-searches-saved-searches-module-ngfactory.js,
app-alerts-saved-searches-saved-searches-module-ngfactory.js.map
(app-alerts-saved-searches-saved-searches-module-ngfactory) 6.25 kB [rendered]
[INFO] chunk {app-login-login-module-ngfactory}
app-login-login-module-ngfactory.js, app-login-login-module-ngfactory.js.map
(app-login-login-module-ngfactory) 5.38 kB [rendered]
[INFO] chunk {app-pcap-pcap-module-ngfactory}
app-pcap-pcap-module-ngfactory.js, app-pcap-pcap-module-ngfactory.js.map
(app-pcap-pcap-module-ngfactory) 11.9 kB [rendered]
[INFO] chunk {main} main.js, main.js.map (main) 2.61 MB [initial] [rendered]
[INFO] chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 415 kB
[initial] [rendered]
[INFO] chunk {runtime} runtime.js, runtime.js.map (runtime) 8.43 kB [entry]
[rendered]
[INFO] chunk {scripts} scripts.js, scripts.js.map (scripts) 986 kB [rendered]
[INFO] chunk {styles} styles.js, styles.js.map (styles) 397 kB [initial]
[rendered]
[INFO] chunk {vendor} vendor.js, vendor.js.map (vendor) 3.47 MB [initial]
[rendered]
[INFO] ℹ 「wdm」: Compiled successfully.
[INFO]
────────────────────────────────────────────────────────────────────────────────────────────────────
[INFO]
[INFO] Running: pcap/pcap.spec.js...
(1 of 1)
[INFO]
[INFO]
[INFO] PCAP Tab
[INFO]
[INFO] ✓ checking running jobs on navigating to PCAP tab (4294ms)
[INFO]
[INFO] ✓ submitting PCAP job request (8675ms)
[INFO]
[INFO] ✓ requesting job status (7166ms)
[INFO]
[INFO] ✓ process status in percentage (7268ms)
[INFO]
[INFO] ✓ getting pcap json (6438ms)
[INFO]
[INFO] 1) rendering pcap table
[INFO]
[INFO] ✓ showing pcap details (7019ms)
[INFO]
[INFO] ✓ navigating accross pages (7083ms)
[INFO]
[INFO] ✓ downloading pdml (7566ms)
[INFO]
[INFO] ✓ cancelling (kill) pcap query job (7820ms)
[INFO]
[INFO] ✓ showing filter validation messages (4060ms)
[INFO]
[INFO] ✓ showing date validation messages (6136ms)
[INFO]
[INFO]
[INFO] 11 passing (1m)
[INFO] 1 failing
[INFO]
[INFO] 1) PCAP Tab rendering pcap table:
[INFO] CypressError: Timed out retrying: cy.click() failed because this
element:
[INFO]
[INFO] <a _ngcontent-c0="" class="nav-link" routerlink="/pcap"
routerlinkactive="active" ng-reflect-router-link="/pcap"
ng-reflect-router-link-active="active" href="/pcap">PCAP</a>
[INFO]
[INFO] is being covered by another element:
[INFO]
[INFO] <div _ngcontent-c2="" class="fill login-pane" style="">...</div>
[INFO]
[INFO] Fix this problem, or use {force: true} to disable error checking.
[INFO]
[INFO] https://on.cypress.io/element-cannot-be-interacted-with
[INFO] at Object.cypressErr
(http://localhost:4200/__cypress/runner/cypress_runner.js:68040:11)
[INFO] at Object.throwErr
(http://localhost:4200/__cypress/runner/cypress_runner.js:68005:18)
[INFO] at Object.throwErrByPath
(http://localhost:4200/__cypress/runner/cypress_runner.js:68032:17)
[INFO] at Object.retry
(http://localhost:4200/__cypress/runner/cypress_runner.js:61785:16)
[INFO] at retryActionability
(http://localhost:4200/__cypress/runner/cypress_runner.js:53584:19)
[INFO] at tryCatcher
(http://localhost:4200/__cypress/runner/cypress_runner.js:7091:23)
[INFO] at Function.Promise.attempt.Promise.try
(http://localhost:4200/__cypress/runner/cypress_runner.js:4470:29)
[INFO] at tryFn
(http://localhost:4200/__cypress/runner/cypress_runner.js:62021:24)
[INFO] at whenStable
(http://localhost:4200/__cypress/runner/cypress_runner.js:62049:12)
[INFO] at
http://localhost:4200/__cypress/runner/cypress_runner.js:61809:16
[INFO] at tryCatcher
(http://localhost:4200/__cypress/runner/cypress_runner.js:7091:23)
[INFO] at Promise._settlePromiseFromHandler
(http://localhost:4200/__cypress/runner/cypress_runner.js:5113:31)
[INFO] at Promise._settlePromise
(http://localhost:4200/__cypress/runner/cypress_runner.js:5170:18)
[INFO] at Promise._settlePromise0
(http://localhost:4200/__cypress/runner/cypress_runner.js:5215:10)
[INFO] at Promise._settlePromises
(http://localhost:4200/__cypress/runner/cypress_runner.js:5294:18)
[INFO] at Promise._fulfill
(http://localhost:4200/__cypress/runner/cypress_runner.js:5239:18)
[INFO] at http://localhost:4200/__cypress/runner/cypress_runner.js:6778:46
[INFO]
[INFO]
[INFO]
[INFO]
[INFO] (Results)
[INFO]
[INFO] ┌────────────────────────────────────┐
[INFO] │ Tests: 12 │
[INFO] │ Passing: 11 │
[INFO] │ Failing: 1 │
[INFO] │ Pending: 0 │
[INFO] │ Skipped: 0 │
[INFO] │ Screenshots: 1 │
[INFO] │ Video: false │
[INFO] │ Duration: 1 minute, 22 seconds │
[INFO] │ Spec Ran: pcap/pcap.spec.js │
[INFO] └────────────────────────────────────┘
[INFO]
[INFO]
[INFO] (Screenshots)
[INFO]
[INFO] -
/home/travis/build/apache/metron/metron-interface/metron-alerts/cypress/screenshots/pcap/pcap.spec.js/PCAP
Tab -- rendering pcap table (failed).png (1280x720)
[INFO]
[INFO]
7====================================================================================================
[INFO]
[INFO] (Run Finished)
7[INFO]
[INFO] Spec Tests Passing
Failing Pending Skipped
[INFO]
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
[INFO] │ ✖ pcap/pcap.spec.js 01:22 12 11
1 - - │
[INFO]
└────────────────────────────────────────────────────────────────────────────────────────────────┘
[INFO] 1 of 1 failed (100%) 01:22 12 11
1 - -
[INFO]
1 2 3 6 6npm ERR! code ELIFECYCLE
[ERROR] npm ERR! errno 1
[ERROR] npm ERR! [email protected] cypress:run: `cypress run`
[ERROR] npm ERR! Exit status 1
[ERROR] npm ERR!
[ERROR] npm ERR! Failed at the [email protected] cypress:run script.
[ERROR] npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.
[ERROR]
[ERROR] npm ERR! A complete log of this run can be found in:
[ERROR] npm ERR! /home/travis/.npm/_logs/2018-12-19T00_57_05_638Z-debug.log
[ERROR] ERROR: "cypress:run" exited with 1.
[ERROR] npm ERR! code ELIFECYCLE
[ERROR] npm ERR! errno 1
[ERROR] npm ERR! [email protected] cypress:ci: `run-p --race start
cypress:run`
[ERROR] npm ERR! Exit status 1
[ERROR] npm ERR!
[ERROR] npm ERR! Failed at the [email protected] cypress:ci script.
[ERROR] npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.
[ERROR]
[ERROR] npm ERR! A complete log of this run can be found in:
[ERROR] npm ERR! /home/travis/.npm/_logs/2018-12-19T00_57_05_716Z-debug.log
[ERROR] npm ERR! code ELIFECYCLE
[ERROR] npm ERR! errno 1
[ERROR] npm ERR! [email protected] testCI: `ng test --watch=false
--browsers=ChromeHeadless && npm run cypress:ci`
[ERROR] npm ERR! Exit status 1
[ERROR] npm ERR!
[ERROR] npm ERR! Failed at the [email protected] testCI script.
[ERROR] npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.
[ERROR]
[ERROR] npm ERR! A complete log of this run can be found in:
[ERROR] npm ERR! /home/travis/.npm/_logs/2018-12-19T00_57_05_730Z-debug.log
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] metron-config ...................................... SUCCESS [02:37 min]
[INFO] metron-alerts ...................................... FAILURE [05:56 min]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
{code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)