Tengda-He / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
0 stars 3 forks source link

Plugin Functional Test stage failing tests #132

Open Carthanial opened 2 years ago

Carthanial commented 2 years ago

Summary :

The Plugin Functional Test stage is failing with the same errors as the Functional Test stage with the before all hook error. It is quite possible that the fix will work for all tests having the issue.

Here is an example of one of the many tests failing with this error :

Plugin Functional Test / custom visualizations self changing vis "before all" hook – Plugin Functional Tests.test/plugin_functional/test_suites/custom_visualizations/self_changing_vis·js

Error: retry.tryForTime timeout: Error: retry.try timeout: Error: retry.try timeout: [POST http://localhost:9515/session/243c3f69e08552797ef6ce29099c0b72/element / {"using":"css selector","value":"[data-test-subj=\"kibanaChrome\"]"}] no such element: Unable to locate element: {"method":"css selector","selector":"[data-test-subj="kibanaChrome"]"} (Session info: headless chrome=79.0.3945.117) (Driver info: chromedriver=79.0.3945.36 (3582db32b33893869b8c1339e8f4d9ed1816f143-refs/branch-heads/3945@{#614}),platform=Linux 5.4.0-1059-aws x86_64) at Server._post (test/functional/services/remote/verbose_remote_logging.js:34:21) at runRequest (node_modules/leadfoot/Session.js:92:40) at node_modules/leadfoot/Session.js:113:39 at new Promise (node_modules/dojo/_debug/Promise.ts:411:4) at Session._post (node_modules/leadfoot/Session.js:67:10) at Session.find (node_modules/leadfoot/Session.js:1328:15) at Command. (node_modules/leadfoot/Command.js:42:36) at node_modules/dojo/_debug/Promise.ts:393:16 at run (node_modules/dojo/_debug/Promise.ts:237:8) at node_modules/dojo/_debug/nextTick.ts:44:4 at process._tickCallback (internal/process/next_tick.js:61:11) at Command.find (node_modules/leadfoot/Command.js:23:10) at Command.prototype.(anonymous function) [as findByCssSelector] (node_modules/leadfoot/lib/strategies.js:29:16) at _ensureElementWithTimeout (test/functional/services/find.js:83:36) at retry.try (test/functional/services/find.js:63:33) at runAttempt (test/common/services/retry/retry_for_success.js:39:21) at retryForSuccess (test/common/services/retry/retry_for_success.js:67:37) at Retry.try (test/common/services/retry/retry.js:37:20) at Find._ensureElementWithTimeout (test/functional/services/find.js:62:22) at Find.byCssSelector (test/functional/services/find.js:82:25) at CommonPage.loginIfPrompted (test/functional/page_objects/common_page.js:73:18) at process._tickCallback (internal/process/next_tick.js:68:7) at lastError (test/common/services/retry/retry_for_success.js:29:9) at retryForSuccess (test/common/services/retry/retry_for_success.js:63:13) at lastError (test/common/services/retry/retry_for_success.js:29:9) at retryForSuccess (test/common/services/retry/retry_for_success.js:63:13) at lastError (test/common/services/retry/retry_for_success.js:29:9) at retryForSuccess (test/common/services/retry/retry_for_success.js:63:13)

└-: custom visualizations [00:02:45] └-> "before all" hook [00:02:45] └-> "before all" hook [00:02:45] │ info [../functional/fixtures/es_archiver/logstash_functional] Loading "mappings.json" [00:02:45] │ info [../functional/fixtures/es_archiver/logstash_functional] Loading "data.json.gz" [00:02:45] │ info [../functional/fixtures/es_archiver/logstash_functional] Skipped restore for existing index "logstash-2015.09.22" [00:02:45] │ info [../functional/fixtures/es_archiver/logstash_functional] Skipped restore for existing index "logstash-2015.09.20" [00:02:45] │ info [../functional/fixtures/es_archiver/logstash_functional] Skipped restore for existing index "logstash-2015.09.21" [00:02:46] │ info [../functional/fixtures/es_archiver/logstash_functional] Indexed 0 docs into "logstash-2015.09.22" [00:02:46] │ info [../functional/fixtures/es_archiver/logstash_functional] Indexed 0 docs into "logstash-2015.09.20" [00:02:46] │ info [../functional/fixtures/es_archiver/logstash_functional] Indexed 0 docs into "logstash-2015.09.21" [00:02:46] │ info [../functional/fixtures/es_archiver/visualize] Loading "mappings.json" [00:02:46] │ info [../functional/fixtures/es_archiver/visualize] Loading "data.json.gz" [00:02:46] │ info [../functional/fixtures/es_archiver/visualize] Deleted existing index [".kibana_1",".kibana_2"] [00:02:46] │ info [../functional/fixtures/es_archiver/visualize] Created index ".kibana" [00:02:46] │ debg [../functional/fixtures/es_archiver/visualize] ".kibana" settings {"index":{"number_of_shards":"1","number_of_replicas":"1"}} [00:02:46] │ info [../functional/fixtures/es_archiver/visualize] Indexed 3 docs into ".kibana" [00:02:49] │ info [migrations] Creating index .kibana_2. [00:02:49] │ info [migrations] Reindexing .kibana to .kibana_1 [00:02:49] │ info [migrations] Migrating .kibana_1 saved objects to .kibana_2 [00:02:49] │ debg [migrations] Migrating saved objects index-pattern:logstash-, index-pattern:logstash, visualization:Shared-Item-Visualization-AreaChart [00:02:50] │ info [migrations] Pointing alias .kibana to .kibana_2. [00:02:50] │ info [migrations] Finished in 522ms. [00:02:51] │ debg replacing kibana config doc: {"dateFormat:tz":"Australia/North","defaultIndex":"logstash-*"} [00:02:52] └-: self changing vis [00:02:52] └-> "before all" hook [00:02:52] └-> "before all" hook [00:02:52] │ debg navigateToApp visualize [00:02:52] │ debg navigating to visualize url: http://localhost:5601/app/kibana#/visualize [00:02:52] │ debg navigate to: http://localhost:5601/app/kibana#/visualize [00:02:52] │ debg ... sleep(700) start [00:02:53] │ debg ... sleep(700) end [00:02:53] │ debg returned from get, calling refresh [00:02:53] │ debg currentUrl = http://localhost:5601/app/kibana#/visualize [00:02:53] │ appUrl = http://localhost:5601/app/kibana#/visualize [00:02:53] │ debg findByCssSelector [data-test-subj="kibanaChrome"] [00:04:13] │ debg --- retry.try error: [POST http://localhost:9515/session/243c3f69e08552797ef6ce29099c0b72/element / {"using":"css selector","value":"[data-test-subj=\"kibanaChrome\"]"}] no such element: Unable to locate element: {"method":"css selector","selector":"[data-test-subj="kibanaChrome"]"} [00:04:13] │ (Session info: headless chrome=79.0.3945.117) [00:04:13] │ (Driver info: chromedriver=79.0.3945.36 (3582db32b33893869b8c1339e8f4d9ed1816f143-refs/branch-heads/3945@{#614}),platform=Linux 5.4.0-1059-aws x86_64) [00:04:14] │ debg --- retry.try error: retry.try timeout: [POST http://localhost:9515/session/243c3f69e08552797ef6ce29099c0b72/element / {"using":"css selector","value":"[data-test-subj=\"kibanaChrome\"]"}] no such element: Unable to locate element: {"method":"css selector","selector":"[data-test-subj="kibanaChrome"]"} [00:04:14] │ (Session info: headless chrome=79.0.3945.117) [00:04:14] │ (Driver info: chromedriver=79.0.3945.36 (3582db32b33893869b8c1339e8f4d9ed1816f143-refs/branch-heads/3945@{#614}),platform=Linux 5.4.0-1059-aws x86_64) [00:04:14] │ at Server._post (/var/lib/jenkins/workspace/Kibana_bfs6.7.2_test_2/test/functional/services/remote/verbose_remote_logging.js:34:21) [00:04:14] │ at runRequest (/var/lib/jenkins/workspace/Kibana_bfs6.7.2_test_2/node_modules/leadfoot/Session.js:92:40) [00:04:14] │ at /var/lib/jenkins/workspace/Kibana_bfs6.7.2_test_2/node_modules/leadfoot/Session.js:113:39 [00:04:14] │ at new Promise (/var/lib/jenkins/workspace/Kibana_bfs6.7.2_test_2/node_modules/dojo/_debug/Promise.ts:411:4) [00:04:14] │ at Session._post (/var/lib/jenkins/workspace/Kibana_bfs6.7.2_test_2/node_modules/leadfoot/Session.js:67:10) [00:04:14] │ at Session.find (/var/lib/jenkins/workspace/Kibana_bfs6.7.2_test_2/node_modules/leadfoot/Session.js:1328:15) [00:04:14] │ at Command. (/var/lib/jenkins/workspace/Kibana_bfs6.7.2_test_2/node_modules/leadfoot/Command.js:42:36) [00:04:14] │ at /var/lib/jenkins/workspace/Kibana_bfs6.7.2_test_2/node_modules/dojo/_debug/Promise.ts:393:16 [00:04:14] │ at run (/var/lib/jenkins/workspace/Kibana_bfs6.7.2_test_2/node_modules/dojo/_debug/Promise.ts:237:8) [00:04:14] │ at /var/lib/jenkins/workspace/Kibana_bfs6.7.2_test_2/node_modules/dojo/_debug/nextTick.ts:44:4 [00:04:14] │ at process._tickCallback (internal/process/next_tick.js:61:11) [00:04:14] │ at Command.find (/var/lib/jenkins/workspace/Kibana_bfs6.7.2_test_2/node_modules/leadfoot/Command.js:23:10) [00:04:14] │ at Command.prototype.(anonymous function) [as findByCssSelector] (/var/lib/jenkins/workspace/Kibana_bfs6.7.2_test_2/node_modules/leadfoot/lib/strategies.js:29:16) [00:04:14] │ at _ensureElementWithTimeout (/var/lib/jenkins/workspace/Kibana_bfs6.7.2_test_2/test/functional/services/find.js:83:36) [00:04:14] │ at retry.try (/var/lib/jenkins/workspace/Kibana_bfs6.7.2_test_2/test/functional/services/find.js:63:33) [00:04:14] │ at runAttempt (/var/lib/jenkins/workspace/Kibana_bfs6.7.2_test_2/test/common/services/retry/retry_for_success.js:39:21) [00:04:14] │ at retryForSuccess (/var/lib/jenkins/workspace/Kibana_bfs6.7.2_test_2/test/common/services/retry/retry_for_success.js:67:37) [00:04:14] │ at Retry.try (/var/lib/jenkins/workspace/Kibana_bfs6.7.2_test_2/test/common/services/retry/retry.js:37:20) [00:04:14] │ at Find._ensureElementWithTimeout (/var/lib/jenkins/workspace/Kibana_bfs6.7.2_test_2/test/functional/services/find.js:62:22) [00:04:14] │ at Find.byCssSelector (/var/lib/jenkins/workspace/Kibana_bfs6.7.2_test_2/test/functional/services/find.js:82:25) [00:04:14] │ at CommonPage.loginIfPrompted (/var/lib/jenkins/workspace/Kibana_bfs6.7.2_test_2/test/functional/page_objects/common_page.js:73:18) [00:04:14] │ at process._tickCallback (internal/process/next_tick.js:68:7)

Carthanial commented 2 years ago

Update :

The error causing this can be seen in the stack trace at debg findByCssSelector [data-test-subj="kibanaChrome"]

The html debug file that is generated from this failed test here shows that at the time this function is called in test/functional/services/find.js on line 80 the dom element kbn_chrome.html has not been mounted on the dom yet and therefore we get the error:

debg --- retry.try error: [POST http://localhost:9515/session/d6d5ec9d7e633c4395999a4bd79e2fb5/element / {"using":"css selector","value":"[data-test-subj=\"kibanaChrome\"]"}] no such element: Unable to locate element: {"method":"css selector","selector":"[data-test-subj="kibanaChrome"]"}

Possible causes & solutions :

It is possible that increasing the timeout & or sleep time could fix the issue or there is a problem with the element being mounted on the dom in the first place.

Carthanial commented 2 years ago

Many of these tests overlap with #127

sidnshah commented 2 years ago

@Carthanial did you find the fix for above problem ?

sidnshah commented 2 years ago

@Carthanial can you point me to the PR if you have fixed this ?