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

Restore webdriver-based functional test runner driver #31446

Merged
merged 14 commits into from
Mar 2, 2019

Conversation

spalger
Copy link
Contributor

@spalger spalger commented Feb 19, 2019

Reopening #26477, we'll take another shot and this time run the tests even more often to make sure we address even more sources of flakiness before merging.

Note: we're running all of the functional tests 6 times per build. Hopefully this will help us see flakiness before we merge into master.

(originally opened as #31388, wanted branch to be on elastic/kibana so we could have separate PRs for each flaky ciGroup)

Closes #27905

log.debug(`Find.existsByDisplayedByCssSelector('${selector}') with timeout=${timeout}`);
return await this.exists(async (driver) => {
const elements = wrapAll(await driver.findElements(By.css(selector)));
return await this.filterElementIsDisplayed(elements);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filtering after the findElements() call like this means that the timeout isn't used if the findElements() call returns elements but none of them are displayed, I'm pretty sure this is the reason we're seeing flakiness like https://kibana-ci.elastic.co/job/elastic+kibana+master/66/JOB=x-pack-ciGroup6,node=immutable/testReport/junit/X-Pack%20Chromium%20Functional%20Reporting%20Tests/x-pack_test_reporting_functional_reporting%C2%B7js/reporting_app_Reporting_Dashboard_Print_PDF_button_becomes_available_when_saved/

I tried to fix this like so https://github.com/elastic/kibana/pull/31368/files#diff-6238cdd3f41d65e4fddb017713976292R209, but it caused other timeout issues, since calls to exist() were waiting for longer, and subsequent timeout calls were missing temporary elements like the success toast here:

[00:20:37]                 │ debg Waiting up to 20000ms for flyout closed...
[00:20:37]                 │ debg TestSubjects.exists(dashboardAddPanel)
[00:20:37]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj~="dashboardAddPanel"]') with timeout=2500
[00:20:48]                 │ debg Find.findByCssSelector('.euiToast') with timeout=10000
...
[00:20:58]                 └- ✖ fail: "dashboard app using current data dashboard snapshots compare area chart snapshot"
[00:20:58]                 │      TimeoutError: Waiting for element to be located By(css selector, .euiToast)
[00:20:58]                 │ Wait timed out after 10033ms
[00:20:58]                 │       at node_modules/selenium-webdriver/lib/webdriver.js:834:17
[00:20:58]                 │       at process._tickCallback (internal/process/next_tick.js:68:7)

https://kibana-ci.elastic.co/job/elastic+kibana+pull-request/1118/JOB=kibana-ciGroup3,node=immutable/testReport/junit/UI%20Functional%20Tests/test_functional_apps_dashboard__dashboard_snapshots%C2%B7js/dashboard_app_using_current_data_dashboard_snapshots_compare_area_chart_snapshot/

@spalger
Copy link
Contributor Author

spalger commented Feb 19, 2019

(copied from #31388 (comment))

💔 Build Failed

[00:04:06]                   │ debg --- retry.try error: unknown error: Element <button class="kuiLocalMenuItem" ng-repeat="menuItem in kbnTopNav.menuItems" aria-label="... Visualization" aria-haspopup="false" aria-expanded="false" aria-disabled="false" ng-class="{'kuiLocalMenuItem-isSelected': kbnTopNav.isCurrent(menuItem.key), 'kuiLocalMenuItem-isDisabled': menuItem.disableButton()}" ng-click="kbnTopNav.handleClick(menuItem, $event)" ng-bind="menuItem.label" tooltip="" tooltip-placement="bottom" tooltip-popup-delay="400" tooltip-append-to-body="1" data-test-subj="visualizeSaveButton">Save</button> is not clickable at point (73, 67). Other element would receive the click: <div class="euiOverlayMask">...</div>

https://kibana-ci.elastic.co/job/elastic+kibana+pull-request/1149/JOB=x-pack-ciGroup6-2,node=immutable/testReport/junit/X-Pack%20Chromium%20Functional%20Reporting%20Tests/x-pack_test_reporting_functional_reporting%C2%B7js/reporting_app_Reporting_Visualize_Print_PDF_button_becomes_available_when_saved/

@spalger
Copy link
Contributor Author

spalger commented Feb 19, 2019

(copied from #31388 (comment))

💔 Build Failed

1 failure in x-pack-ciGroup7

[00:09:41]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj~="globalLoadingIndicator"]') with timeout=2500
[00:09:44]                   │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:09:44]                   │ debg Find.existsByCssSelector('[data-test-subj~="globalLoadingIndicator-hidden"]') with timeout=100000
[00:09:44]                   │ debg TestSubjects.click(mapListingTitleLink-[Flights]-Origin-and-Destination-Flight-Time)
[00:09:44]                   │ debg Find.clickByCssSelector('[data-test-subj~="mapListingTitleLink-[Flights]-Origin-and-Destination-Flight-Time"]') with timeout=10000
[00:09:44]                   │ debg Find.findByCssSelector('[data-test-subj~="mapListingTitleLink-[Flights]-Origin-and-Destination-Flight-Time"]') with timeout=10000
[00:09:54]                   │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj~="mapListingTitleLink-[Flights]-Origin-and-Destination-Flight-Time"])
[00:09:54]                   │      Wait timed out after 10026ms
[00:09:54]                   │ debg Find.findByCssSelector('[data-test-subj~="mapListingTitleLink-[Flights]-Origin-and-Destination-Flight-Time"]') with timeout=10000
...
[00:11:50]                   │ debg --- retry.try error: retry.try timeout: TimeoutError: Waiting for element to be located By(css selector, [data-test-subj~="mapListingTitleLink-[Flights]-Origin-and-Destination-Flight-Time"])
[00:11:50]                   │      Wait timed out after 10043ms
[00:11:50]                   │          at /var/lib/jenkins/workspace/elastic+kibana+pull-request/JOB/x-pack-ciGroup7-3/node/immutable/kibana/node_modules/selenium-webdriver/lib/webdriver.js:834:17
[00:11:50]                   │          at process._tickCallback (internal/process/next_tick.js:68:7)
...
[00:11:51]                   └- ✖ fail: "maps app  maps loaded from sample data flights "before all" hook"
[00:11:51]                   │      Error: retry.try timeout: Error: retry.try timeout: TimeoutError: Waiting for element to be located By(css selector, [data-test-subj~="mapListingTitleLink-[Flights]-Origin-and-Destination-Flight-Time"])
[00:11:51]                   │ Wait timed out after 10043ms
[00:11:51]                   │     at /var/lib/jenkins/workspace/elastic+kibana+pull-request/JOB/x-pack-ciGroup7-3/node/immutable/kibana/node_modules/selenium-webdriver/lib/webdriver.js:834:17
[00:11:51]                   │     at process._tickCallback (internal/process/next_tick.js:68:7)
[00:11:51]                   │     at lastError (/var/lib/jenkins/workspace/elastic+kibana+pull-request/JOB/x-pack-ciGroup7-3/node/immutable/kibana/test/common/services/retry/retry_for_success.js:29:9)
[00:11:51]                   │     at retryForSuccess (/var/lib/jenkins/workspace/elastic+kibana+pull-request/JOB/x-pack-ciGroup7-3/node/immutable/kibana/test/common/services/retry/retry_for_success.js:63:13)
[00:11:51]                   │       at lastError (/var/lib/jenkins/workspace/elastic+kibana+pull-request/JOB/x-pack-ciGroup7-3/node/immutable/kibana/test/common/services/retry/retry_for_success.js:29:9)
[00:11:51]                   │       at retryForSuccess (/var/lib/jenkins/workspace/elastic+kibana+pull-request/JOB/x-pack-ciGroup7-3/node/immutable/kibana/test/common/services/retry/retry_for_success.js:63:13)

image

@spalger
Copy link
Contributor Author

spalger commented Feb 19, 2019

(copied from #31388 (comment))

💔 Build Failed

1 Failure in x-pack-ciGroup6

This one appears to be related to the issue described in #31388 (comment)

# note times, the timeout was basically ignored, it failed "instantly"
[00:01:36]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj~="saveDashboardSuccess"]') with timeout=120000
...
[00:01:37]                   └- ✖ fail: "reporting app Reporting Dashboard Print PDF button becomes available when saved"
[00:01:37]                   │      Error: expected testSubject(saveDashboardSuccess) to exist
[00:01:37]                   │       at TestSubjects.existOrFail (/var/lib/jenkins/workspace/elastic+kibana+pull-request/JOB/x-pack-ciGroup6-2/node/immutable/kibana/test/functional/services/test_subjects.js:53:15)
[00:01:37]                   │       at process._tickCallback (internal/process/next_tick.js:68:7)

image

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@spalger
Copy link
Contributor Author

spalger commented Feb 19, 2019

retest

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@spalger
Copy link
Contributor Author

spalger commented Feb 19, 2019

Retest

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@spalger
Copy link
Contributor Author

spalger commented Feb 19, 2019

retest

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@dmlemeshko
Copy link
Member

retest

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💔 Build Failed

@dmlemeshko
Copy link
Member

1 failure which is expected:

X-Pack Chromium Functional Reporting Tests.x-pack/test/reporting/functional/reporting·js.reporting app Reporting Dashboard Print PNG button becomes available when saved

PR #31447 has a fix for it.

* rerun x-pack-ciGroup6 40 times

* improve reporting tests stability (#31454)
Copy link
Contributor

@cuff-links cuff-links left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went through this pretty finely. I think since we merged a bunch of smaller PRs into this branch, that helped this branch to be relatively easy to review. I also pulled this locally and ran the tests x 3 (using TEST_THROTTLE_NETWORK and got 3 green builds. That's amazing! I approve these changes and all they stand for!

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@spalger
Copy link
Contributor Author

spalger commented Mar 1, 2019

retest

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@spalger
Copy link
Contributor Author

spalger commented Mar 1, 2019

retest

1 similar comment
@spalger
Copy link
Contributor Author

spalger commented Mar 2, 2019

retest

@elasticmachine

This comment has been minimized.

@dmlemeshko
Copy link
Member

1 job failed due to CI (probably )overload.

00:22:15 $ node ./preinstall_check
00:22:15 [1/5] Validating package.json...
00:22:15 [2/5] Resolving packages...
00:22:16 [3/5] Fetching packages...
00:22:20 FATAL: command execution failed
00:22:20 java.nio.channels.ClosedChannelException
00:22:20 	at org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
00:22:20 	at org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:142)
00:22:20 	at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:795)
00:22:20 	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
00:22:20 	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
00:22:20 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
00:22:20 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
00:22:20 	at java.lang.Thread.run(Thread.java:748)
00:22:20 Caused: java.io.IOException: Backing channel 'JNLP4-connect connection from kibana-ci-immutable-ubuntu-1551480492822590185.c.elastic-ci-prod.internal/10.224.1.167:38462' is disconnected.

@spalger
Copy link
Contributor Author

spalger commented Mar 2, 2019

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@spalger spalger removed the WIP Work in progress label Mar 2, 2019
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@spalger spalger merged commit a6afcc5 into master Mar 2, 2019
@dmlemeshko dmlemeshko mentioned this pull request Mar 4, 2019
3 tasks
dmlemeshko added a commit to dmlemeshko/kibana that referenced this pull request Mar 4, 2019
@spalger spalger deleted the implement/ftr-webdriver branch March 5, 2019 15:53
dmlemeshko pushed a commit to dmlemeshko/kibana that referenced this pull request Mar 6, 2019
dmlemeshko pushed a commit to dmlemeshko/kibana that referenced this pull request Mar 9, 2019
@dmlemeshko
Copy link
Member

Backported
7.0 53ecc0b
7.x 34123b0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants