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

[ftr] abort retry on invalid webdriver session #174092

Conversation

dmlemeshko
Copy link
Member

@dmlemeshko dmlemeshko commented Jan 2, 2024

Summary

Since many our e2e tests use Retry service, we might have a situation with retry running for some time (20,30, 120 seconds ) before reaching timeout while browser already crashed and Webdriver is not functioning properly.

This PR updates Retry service with checking error name before retry attempt: if it is the WebDriver critical error, retry is aborted and we fail test fast.

It should help with long useless logging messages as well:

Before:

         │ debg --- retry.try error: no such window: target window already closed
         │      from unknown error: web view not found
         │        (Session info: chrome=120.0.6099.129)
         │ debg Find.findByCssSelector('[data-test-subj="canvasExpressionInput"]') with timeout=10000
         │ debg --- retry.try failed again with the same message...
         │ debg Find.findByCssSelector('[data-test-subj="canvasExpressionInput"]') with timeout=10000
         │ debg --- retry.try failed again with the same message...
         ...
         │ERROR Browser is closed, no artifacts were captured for the failure
         └- ✖ fail: Canvas Canvas app expression editor shows autocomplete when typing
         │      retry.try timeout: NoSuchWindowError: no such window: target window already closed
         │ from unknown error: web view not found
         │   (Session info: chrome=120.0.6099.129)
         │     at Object.throwDecodedError (/Users/dmle/github/kibana/node_modules/selenium-webdriver/lib/error.js:524:15)
         │     at parseHttpResponse (/Users/dmle/github/kibana/node_modules/selenium-webdriver/lib/http.js:601:13)
         │     at Executor.execute (/Users/dmle/github/kibana/node_modules/selenium-webdriver/lib/http.js:529:28)
         │     at processTicksAndRejections (node:internal/process/task_queues:95:5)
         │     at Task.exec (prevent_parallel_calls.ts:28:20)
         │   Error: retry.try timeout: NoSuchWindowError: no such window: target window already closed
         │   from unknown error: web view not found
         │     (Session info: chrome=120.0.6099.129)
         │       at Object.throwDecodedError (node_modules/selenium-webdriver/lib/error.js:524:15)
         │       at parseHttpResponse (node_modules/selenium-webdriver/lib/http.js:601:13)
         │       at Executor.execute (node_modules/selenium-webdriver/lib/http.js:529:28)
         │       at processTicksAndRejections (node:internal/process/task_queues:95:5)
         │       at Task.exec (prevent_parallel_calls.ts:28:20)
         │       at onFailure (retry_for_success.ts:17:9)
         │       at retryForSuccess (retry_for_success.ts:59:13)
         │       at RetryService.try (retry.ts:31:12)
         │       at Proxy.clickByCssSelector (find.ts:417:5)
         │       at TestSubjects.click (test_subjects.ts:164:5)
         │       at Context.<anonymous> (expression.ts:92:7)
         │       at Object.apply (wrap_function.js:73:16)
         │
         │
       └-> "after all" hook for "shows autocomplete when typing"
         │ debg unloading docs from archive at /Users/dmle/github/kibana/x-pack/test/functional/fixtures/kbn_archiver/canvas/default.json
         │ info deleting 1 objects { space: undefined }
         │ succ 1 saved objects deleted
       └-> "after all" hook: afterTestSuite.trigger for "shows autocomplete when typing"
         │ERROR Browser window is already closed

After:

         │ debg --- retry.try error: no such window: target window already closed
         │      from unknown error: web view not found
         │        (Session info: chrome=120.0.6099.129)
         │ERROR Browser is closed, no artifacts were captured for the failure
         └- ✖ fail: Canvas Canvas app expression editor shows autocomplete when typing
         │      Error: WebDriver session is invalid, retry was aborted
         │       at retryForSuccess (retry_for_success.ts:64:13)
         │       at RetryService.try (retry.ts:31:12)
         │       at MonacoEditorService.getCodeEditorValue (monaco_editor.ts:25:5)
         │       at Context.<anonymous> (expression.ts:83:34)
         │       at Object.apply (wrap_function.js:73:16)
         │
         │
       └-> "after all" hook for "shows autocomplete when typing"
         │ debg unloading docs from archive at /Users/dmle/github/kibana/x-pack/test/functional/fixtures/kbn_archiver/canvas/default.json
         │ info deleting 1 objects { space: undefined }
         │ succ 1 saved objects deleted
       └-> "after all" hook: afterTestSuite.trigger for "shows autocomplete when typing"
         │ERROR Browser window is already closed
     └-> "after all" hook in "Canvas app"
       │ debg set roles = superuser
       │ debg creating user test_user
       │ debg created user test_user
     └-> "after all" hook: afterTestSuite.trigger in "Canvas app"
       │ERROR Browser window is already closed
   └-> "after all" hook: afterTestSuite.trigger in "Canvas"
     │ERROR Browser window is already closed

5 passing (17.0s)
1 failing

1)    Canvas
       Canvas app
         expression editor
           shows autocomplete when typing:

      Error: WebDriver session is invalid, retry was aborted
       at retryForSuccess (retry_for_success.ts:64:13)
       at RetryService.try (retry.ts:31:12)
       at MonacoEditorService.getCodeEditorValue (monaco_editor.ts:25:5)
       at Context.<anonymous> (expression.ts:83:34)
       at Object.apply (wrap_function.js:73:16)


@dmlemeshko dmlemeshko requested review from a team as code owners January 2, 2024 15:35
@dmlemeshko dmlemeshko added release_note:skip Skip the PR/issue when compiling release notes v8.12.1 v8.13.0 labels Jan 2, 2024
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Member

@pheyos pheyos left a comment

Choose a reason for hiding this comment

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

Code LGTM

@dmlemeshko dmlemeshko merged commit f9a4962 into elastic:main Jan 2, 2024
27 checks passed
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 2, 2024
## Summary

Since many our e2e tests use Retry service, we might have a situation
with retry running for some time (**20,30, 120 seconds** ) before
reaching timeout while browser already crashed and Webdriver is not
functioning properly.

This PR updates Retry service with checking error name before retry
attempt: if it is the WebDriver critical error, retry is aborted and we
fail test fast.

It should help with long useless logging messages as well:

Before:

```
         │ debg --- retry.try error: no such window: target window already closed
         │      from unknown error: web view not found
         │        (Session info: chrome=120.0.6099.129)
         │ debg Find.findByCssSelector('[data-test-subj="canvasExpressionInput"]') with timeout=10000
         │ debg --- retry.try failed again with the same message...
         │ debg Find.findByCssSelector('[data-test-subj="canvasExpressionInput"]') with timeout=10000
         │ debg --- retry.try failed again with the same message...
         ...
         │ERROR Browser is closed, no artifacts were captured for the failure
         └- ✖ fail: Canvas Canvas app expression editor shows autocomplete when typing
         │      retry.try timeout: NoSuchWindowError: no such window: target window already closed
         │ from unknown error: web view not found
         │   (Session info: chrome=120.0.6099.129)
         │     at Object.throwDecodedError (/Users/dmle/github/kibana/node_modules/selenium-webdriver/lib/error.js:524:15)
         │     at parseHttpResponse (/Users/dmle/github/kibana/node_modules/selenium-webdriver/lib/http.js:601:13)
         │     at Executor.execute (/Users/dmle/github/kibana/node_modules/selenium-webdriver/lib/http.js:529:28)
         │     at processTicksAndRejections (node:internal/process/task_queues:95:5)
         │     at Task.exec (prevent_parallel_calls.ts:28:20)
         │   Error: retry.try timeout: NoSuchWindowError: no such window: target window already closed
         │   from unknown error: web view not found
         │     (Session info: chrome=120.0.6099.129)
         │       at Object.throwDecodedError (node_modules/selenium-webdriver/lib/error.js:524:15)
         │       at parseHttpResponse (node_modules/selenium-webdriver/lib/http.js:601:13)
         │       at Executor.execute (node_modules/selenium-webdriver/lib/http.js:529:28)
         │       at processTicksAndRejections (node:internal/process/task_queues:95:5)
         │       at Task.exec (prevent_parallel_calls.ts:28:20)
         │       at onFailure (retry_for_success.ts:17:9)
         │       at retryForSuccess (retry_for_success.ts:59:13)
         │       at RetryService.try (retry.ts:31:12)
         │       at Proxy.clickByCssSelector (find.ts:417:5)
         │       at TestSubjects.click (test_subjects.ts:164:5)
         │       at Context.<anonymous> (expression.ts:92:7)
         │       at Object.apply (wrap_function.js:73:16)
         │
         │
       └-> "after all" hook for "shows autocomplete when typing"
         │ debg unloading docs from archive at /Users/dmle/github/kibana/x-pack/test/functional/fixtures/kbn_archiver/canvas/default.json
         │ info deleting 1 objects { space: undefined }
         │ succ 1 saved objects deleted
       └-> "after all" hook: afterTestSuite.trigger for "shows autocomplete when typing"
         │ERROR Browser window is already closed
```

After:

```
         │ debg --- retry.try error: no such window: target window already closed
         │      from unknown error: web view not found
         │        (Session info: chrome=120.0.6099.129)
         │ERROR Browser is closed, no artifacts were captured for the failure
         └- ✖ fail: Canvas Canvas app expression editor shows autocomplete when typing
         │      Error: WebDriver session is invalid, retry was aborted
         │       at retryForSuccess (retry_for_success.ts:64:13)
         │       at RetryService.try (retry.ts:31:12)
         │       at MonacoEditorService.getCodeEditorValue (monaco_editor.ts:25:5)
         │       at Context.<anonymous> (expression.ts:83:34)
         │       at Object.apply (wrap_function.js:73:16)
         │
         │
       └-> "after all" hook for "shows autocomplete when typing"
         │ debg unloading docs from archive at /Users/dmle/github/kibana/x-pack/test/functional/fixtures/kbn_archiver/canvas/default.json
         │ info deleting 1 objects { space: undefined }
         │ succ 1 saved objects deleted
       └-> "after all" hook: afterTestSuite.trigger for "shows autocomplete when typing"
         │ERROR Browser window is already closed
     └-> "after all" hook in "Canvas app"
       │ debg set roles = superuser
       │ debg creating user test_user
       │ debg created user test_user
     └-> "after all" hook: afterTestSuite.trigger in "Canvas app"
       │ERROR Browser window is already closed
   └-> "after all" hook: afterTestSuite.trigger in "Canvas"
     │ERROR Browser window is already closed

5 passing (17.0s)
1 failing

1)    Canvas
       Canvas app
         expression editor
           shows autocomplete when typing:

      Error: WebDriver session is invalid, retry was aborted
       at retryForSuccess (retry_for_success.ts:64:13)
       at RetryService.try (retry.ts:31:12)
       at MonacoEditorService.getCodeEditorValue (monaco_editor.ts:25:5)
       at Context.<anonymous> (expression.ts:83:34)
       at Object.apply (wrap_function.js:73:16)

```

(cherry picked from commit f9a4962)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.12

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jan 2, 2024
)

# Backport

This will backport the following commits from `main` to `8.12`:
- [[ftr] abort retry on invalid webdriver session
(#174092)](#174092)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Dzmitry
Lemechko","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-01-02T21:01:26Z","message":"[ftr]
abort retry on invalid webdriver session (#174092)\n\n##
Summary\r\n\r\nSince many our e2e tests use Retry service, we might have
a situation\r\nwith retry running for some time (**20,30, 120 seconds**
) before\r\nreaching timeout while browser already crashed and Webdriver
is not\r\nfunctioning properly.\r\n\r\nThis PR updates Retry service
with checking error name before retry\r\nattempt: if it is the WebDriver
critical error, retry is aborted and we\r\nfail test fast.\r\n\r\nIt
should help with long useless logging messages as
well:\r\n\r\nBefore:\r\n\r\n```\r\n │ debg --- retry.try error: no such
window: target window already closed\r\n │ from unknown error: web view
not found\r\n │ (Session info: chrome=120.0.6099.129)\r\n │ debg
Find.findByCssSelector('[data-test-subj=\"canvasExpressionInput\"]')
with timeout=10000\r\n │ debg --- retry.try failed again with the same
message...\r\n │ debg
Find.findByCssSelector('[data-test-subj=\"canvasExpressionInput\"]')
with timeout=10000\r\n │ debg --- retry.try failed again with the same
message...\r\n ...\r\n │ERROR Browser is closed, no artifacts were
captured for the failure\r\n └- ✖ fail: Canvas Canvas app expression
editor shows autocomplete when typing\r\n │ retry.try timeout:
NoSuchWindowError: no such window: target window already closed\r\n │
from unknown error: web view not found\r\n │ (Session info:
chrome=120.0.6099.129)\r\n │ at Object.throwDecodedError
(/Users/dmle/github/kibana/node_modules/selenium-webdriver/lib/error.js:524:15)\r\n
│ at parseHttpResponse
(/Users/dmle/github/kibana/node_modules/selenium-webdriver/lib/http.js:601:13)\r\n
│ at Executor.execute
(/Users/dmle/github/kibana/node_modules/selenium-webdriver/lib/http.js:529:28)\r\n
│ at processTicksAndRejections
(node:internal/process/task_queues:95:5)\r\n │ at Task.exec
(prevent_parallel_calls.ts:28:20)\r\n │ Error: retry.try timeout:
NoSuchWindowError: no such window: target window already closed\r\n │
from unknown error: web view not found\r\n │ (Session info:
chrome=120.0.6099.129)\r\n │ at Object.throwDecodedError
(node_modules/selenium-webdriver/lib/error.js:524:15)\r\n │ at
parseHttpResponse
(node_modules/selenium-webdriver/lib/http.js:601:13)\r\n │ at
Executor.execute
(node_modules/selenium-webdriver/lib/http.js:529:28)\r\n │ at
processTicksAndRejections (node:internal/process/task_queues:95:5)\r\n │
at Task.exec (prevent_parallel_calls.ts:28:20)\r\n │ at onFailure
(retry_for_success.ts:17:9)\r\n │ at retryForSuccess
(retry_for_success.ts:59:13)\r\n │ at RetryService.try
(retry.ts:31:12)\r\n │ at Proxy.clickByCssSelector (find.ts:417:5)\r\n │
at TestSubjects.click (test_subjects.ts:164:5)\r\n │ at
Context.<anonymous> (expression.ts:92:7)\r\n │ at Object.apply
(wrap_function.js:73:16)\r\n │\r\n │\r\n └-> \"after all\" hook for
\"shows autocomplete when typing\"\r\n │ debg unloading docs from
archive at
/Users/dmle/github/kibana/x-pack/test/functional/fixtures/kbn_archiver/canvas/default.json\r\n
│ info deleting 1 objects { space: undefined }\r\n │ succ 1 saved
objects deleted\r\n └-> \"after all\" hook: afterTestSuite.trigger for
\"shows autocomplete when typing\"\r\n │ERROR Browser window is already
closed\r\n``` \r\n\r\nAfter:\r\n\r\n```\r\n │ debg --- retry.try error:
no such window: target window already closed\r\n │ from unknown error:
web view not found\r\n │ (Session info: chrome=120.0.6099.129)\r\n
│ERROR Browser is closed, no artifacts were captured for the failure\r\n
└- ✖ fail: Canvas Canvas app expression editor shows autocomplete when
typing\r\n │ Error: WebDriver session is invalid, retry was aborted\r\n
│ at retryForSuccess (retry_for_success.ts:64:13)\r\n │ at
RetryService.try (retry.ts:31:12)\r\n │ at
MonacoEditorService.getCodeEditorValue (monaco_editor.ts:25:5)\r\n │ at
Context.<anonymous> (expression.ts:83:34)\r\n │ at Object.apply
(wrap_function.js:73:16)\r\n │\r\n │\r\n └-> \"after all\" hook for
\"shows autocomplete when typing\"\r\n │ debg unloading docs from
archive at
/Users/dmle/github/kibana/x-pack/test/functional/fixtures/kbn_archiver/canvas/default.json\r\n
│ info deleting 1 objects { space: undefined }\r\n │ succ 1 saved
objects deleted\r\n └-> \"after all\" hook: afterTestSuite.trigger for
\"shows autocomplete when typing\"\r\n │ERROR Browser window is already
closed\r\n └-> \"after all\" hook in \"Canvas app\"\r\n │ debg set roles
= superuser\r\n │ debg creating user test_user\r\n │ debg created user
test_user\r\n └-> \"after all\" hook: afterTestSuite.trigger in \"Canvas
app\"\r\n │ERROR Browser window is already closed\r\n └-> \"after all\"
hook: afterTestSuite.trigger in \"Canvas\"\r\n │ERROR Browser window is
already closed\r\n\r\n5 passing (17.0s)\r\n1 failing\r\n\r\n1)
Canvas\r\n Canvas app\r\n expression editor\r\n shows autocomplete when
typing:\r\n\r\n Error: WebDriver session is invalid, retry was
aborted\r\n at retryForSuccess (retry_for_success.ts:64:13)\r\n at
RetryService.try (retry.ts:31:12)\r\n at
MonacoEditorService.getCodeEditorValue (monaco_editor.ts:25:5)\r\n at
Context.<anonymous> (expression.ts:83:34)\r\n at Object.apply
(wrap_function.js:73:16)\r\n\r\n\r\n```","sha":"f9a4962b4802a520bd7ab3788138cd1c75e7de3a","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v8.12.1","v8.13.0"],"title":"[ftr]
abort retry on invalid webdriver
session","number":174092,"url":"https://github.com/elastic/kibana/pull/174092","mergeCommit":{"message":"[ftr]
abort retry on invalid webdriver session (#174092)\n\n##
Summary\r\n\r\nSince many our e2e tests use Retry service, we might have
a situation\r\nwith retry running for some time (**20,30, 120 seconds**
) before\r\nreaching timeout while browser already crashed and Webdriver
is not\r\nfunctioning properly.\r\n\r\nThis PR updates Retry service
with checking error name before retry\r\nattempt: if it is the WebDriver
critical error, retry is aborted and we\r\nfail test fast.\r\n\r\nIt
should help with long useless logging messages as
well:\r\n\r\nBefore:\r\n\r\n```\r\n │ debg --- retry.try error: no such
window: target window already closed\r\n │ from unknown error: web view
not found\r\n │ (Session info: chrome=120.0.6099.129)\r\n │ debg
Find.findByCssSelector('[data-test-subj=\"canvasExpressionInput\"]')
with timeout=10000\r\n │ debg --- retry.try failed again with the same
message...\r\n │ debg
Find.findByCssSelector('[data-test-subj=\"canvasExpressionInput\"]')
with timeout=10000\r\n │ debg --- retry.try failed again with the same
message...\r\n ...\r\n │ERROR Browser is closed, no artifacts were
captured for the failure\r\n └- ✖ fail: Canvas Canvas app expression
editor shows autocomplete when typing\r\n │ retry.try timeout:
NoSuchWindowError: no such window: target window already closed\r\n │
from unknown error: web view not found\r\n │ (Session info:
chrome=120.0.6099.129)\r\n │ at Object.throwDecodedError
(/Users/dmle/github/kibana/node_modules/selenium-webdriver/lib/error.js:524:15)\r\n
│ at parseHttpResponse
(/Users/dmle/github/kibana/node_modules/selenium-webdriver/lib/http.js:601:13)\r\n
│ at Executor.execute
(/Users/dmle/github/kibana/node_modules/selenium-webdriver/lib/http.js:529:28)\r\n
│ at processTicksAndRejections
(node:internal/process/task_queues:95:5)\r\n │ at Task.exec
(prevent_parallel_calls.ts:28:20)\r\n │ Error: retry.try timeout:
NoSuchWindowError: no such window: target window already closed\r\n │
from unknown error: web view not found\r\n │ (Session info:
chrome=120.0.6099.129)\r\n │ at Object.throwDecodedError
(node_modules/selenium-webdriver/lib/error.js:524:15)\r\n │ at
parseHttpResponse
(node_modules/selenium-webdriver/lib/http.js:601:13)\r\n │ at
Executor.execute
(node_modules/selenium-webdriver/lib/http.js:529:28)\r\n │ at
processTicksAndRejections (node:internal/process/task_queues:95:5)\r\n │
at Task.exec (prevent_parallel_calls.ts:28:20)\r\n │ at onFailure
(retry_for_success.ts:17:9)\r\n │ at retryForSuccess
(retry_for_success.ts:59:13)\r\n │ at RetryService.try
(retry.ts:31:12)\r\n │ at Proxy.clickByCssSelector (find.ts:417:5)\r\n │
at TestSubjects.click (test_subjects.ts:164:5)\r\n │ at
Context.<anonymous> (expression.ts:92:7)\r\n │ at Object.apply
(wrap_function.js:73:16)\r\n │\r\n │\r\n └-> \"after all\" hook for
\"shows autocomplete when typing\"\r\n │ debg unloading docs from
archive at
/Users/dmle/github/kibana/x-pack/test/functional/fixtures/kbn_archiver/canvas/default.json\r\n
│ info deleting 1 objects { space: undefined }\r\n │ succ 1 saved
objects deleted\r\n └-> \"after all\" hook: afterTestSuite.trigger for
\"shows autocomplete when typing\"\r\n │ERROR Browser window is already
closed\r\n``` \r\n\r\nAfter:\r\n\r\n```\r\n │ debg --- retry.try error:
no such window: target window already closed\r\n │ from unknown error:
web view not found\r\n │ (Session info: chrome=120.0.6099.129)\r\n
│ERROR Browser is closed, no artifacts were captured for the failure\r\n
└- ✖ fail: Canvas Canvas app expression editor shows autocomplete when
typing\r\n │ Error: WebDriver session is invalid, retry was aborted\r\n
│ at retryForSuccess (retry_for_success.ts:64:13)\r\n │ at
RetryService.try (retry.ts:31:12)\r\n │ at
MonacoEditorService.getCodeEditorValue (monaco_editor.ts:25:5)\r\n │ at
Context.<anonymous> (expression.ts:83:34)\r\n │ at Object.apply
(wrap_function.js:73:16)\r\n │\r\n │\r\n └-> \"after all\" hook for
\"shows autocomplete when typing\"\r\n │ debg unloading docs from
archive at
/Users/dmle/github/kibana/x-pack/test/functional/fixtures/kbn_archiver/canvas/default.json\r\n
│ info deleting 1 objects { space: undefined }\r\n │ succ 1 saved
objects deleted\r\n └-> \"after all\" hook: afterTestSuite.trigger for
\"shows autocomplete when typing\"\r\n │ERROR Browser window is already
closed\r\n └-> \"after all\" hook in \"Canvas app\"\r\n │ debg set roles
= superuser\r\n │ debg creating user test_user\r\n │ debg created user
test_user\r\n └-> \"after all\" hook: afterTestSuite.trigger in \"Canvas
app\"\r\n │ERROR Browser window is already closed\r\n └-> \"after all\"
hook: afterTestSuite.trigger in \"Canvas\"\r\n │ERROR Browser window is
already closed\r\n\r\n5 passing (17.0s)\r\n1 failing\r\n\r\n1)
Canvas\r\n Canvas app\r\n expression editor\r\n shows autocomplete when
typing:\r\n\r\n Error: WebDriver session is invalid, retry was
aborted\r\n at retryForSuccess (retry_for_success.ts:64:13)\r\n at
RetryService.try (retry.ts:31:12)\r\n at
MonacoEditorService.getCodeEditorValue (monaco_editor.ts:25:5)\r\n at
Context.<anonymous> (expression.ts:83:34)\r\n at Object.apply
(wrap_function.js:73:16)\r\n\r\n\r\n```","sha":"f9a4962b4802a520bd7ab3788138cd1c75e7de3a"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"8.12","label":"v8.12.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.13.0","branchLabelMappingKey":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/174092","number":174092,"mergeCommit":{"message":"[ftr]
abort retry on invalid webdriver session (#174092)\n\n##
Summary\r\n\r\nSince many our e2e tests use Retry service, we might have
a situation\r\nwith retry running for some time (**20,30, 120 seconds**
) before\r\nreaching timeout while browser already crashed and Webdriver
is not\r\nfunctioning properly.\r\n\r\nThis PR updates Retry service
with checking error name before retry\r\nattempt: if it is the WebDriver
critical error, retry is aborted and we\r\nfail test fast.\r\n\r\nIt
should help with long useless logging messages as
well:\r\n\r\nBefore:\r\n\r\n```\r\n │ debg --- retry.try error: no such
window: target window already closed\r\n │ from unknown error: web view
not found\r\n │ (Session info: chrome=120.0.6099.129)\r\n │ debg
Find.findByCssSelector('[data-test-subj=\"canvasExpressionInput\"]')
with timeout=10000\r\n │ debg --- retry.try failed again with the same
message...\r\n │ debg
Find.findByCssSelector('[data-test-subj=\"canvasExpressionInput\"]')
with timeout=10000\r\n │ debg --- retry.try failed again with the same
message...\r\n ...\r\n │ERROR Browser is closed, no artifacts were
captured for the failure\r\n └- ✖ fail: Canvas Canvas app expression
editor shows autocomplete when typing\r\n │ retry.try timeout:
NoSuchWindowError: no such window: target window already closed\r\n │
from unknown error: web view not found\r\n │ (Session info:
chrome=120.0.6099.129)\r\n │ at Object.throwDecodedError
(/Users/dmle/github/kibana/node_modules/selenium-webdriver/lib/error.js:524:15)\r\n
│ at parseHttpResponse
(/Users/dmle/github/kibana/node_modules/selenium-webdriver/lib/http.js:601:13)\r\n
│ at Executor.execute
(/Users/dmle/github/kibana/node_modules/selenium-webdriver/lib/http.js:529:28)\r\n
│ at processTicksAndRejections
(node:internal/process/task_queues:95:5)\r\n │ at Task.exec
(prevent_parallel_calls.ts:28:20)\r\n │ Error: retry.try timeout:
NoSuchWindowError: no such window: target window already closed\r\n │
from unknown error: web view not found\r\n │ (Session info:
chrome=120.0.6099.129)\r\n │ at Object.throwDecodedError
(node_modules/selenium-webdriver/lib/error.js:524:15)\r\n │ at
parseHttpResponse
(node_modules/selenium-webdriver/lib/http.js:601:13)\r\n │ at
Executor.execute
(node_modules/selenium-webdriver/lib/http.js:529:28)\r\n │ at
processTicksAndRejections (node:internal/process/task_queues:95:5)\r\n │
at Task.exec (prevent_parallel_calls.ts:28:20)\r\n │ at onFailure
(retry_for_success.ts:17:9)\r\n │ at retryForSuccess
(retry_for_success.ts:59:13)\r\n │ at RetryService.try
(retry.ts:31:12)\r\n │ at Proxy.clickByCssSelector (find.ts:417:5)\r\n │
at TestSubjects.click (test_subjects.ts:164:5)\r\n │ at
Context.<anonymous> (expression.ts:92:7)\r\n │ at Object.apply
(wrap_function.js:73:16)\r\n │\r\n │\r\n └-> \"after all\" hook for
\"shows autocomplete when typing\"\r\n │ debg unloading docs from
archive at
/Users/dmle/github/kibana/x-pack/test/functional/fixtures/kbn_archiver/canvas/default.json\r\n
│ info deleting 1 objects { space: undefined }\r\n │ succ 1 saved
objects deleted\r\n └-> \"after all\" hook: afterTestSuite.trigger for
\"shows autocomplete when typing\"\r\n │ERROR Browser window is already
closed\r\n``` \r\n\r\nAfter:\r\n\r\n```\r\n │ debg --- retry.try error:
no such window: target window already closed\r\n │ from unknown error:
web view not found\r\n │ (Session info: chrome=120.0.6099.129)\r\n
│ERROR Browser is closed, no artifacts were captured for the failure\r\n
└- ✖ fail: Canvas Canvas app expression editor shows autocomplete when
typing\r\n │ Error: WebDriver session is invalid, retry was aborted\r\n
│ at retryForSuccess (retry_for_success.ts:64:13)\r\n │ at
RetryService.try (retry.ts:31:12)\r\n │ at
MonacoEditorService.getCodeEditorValue (monaco_editor.ts:25:5)\r\n │ at
Context.<anonymous> (expression.ts:83:34)\r\n │ at Object.apply
(wrap_function.js:73:16)\r\n │\r\n │\r\n └-> \"after all\" hook for
\"shows autocomplete when typing\"\r\n │ debg unloading docs from
archive at
/Users/dmle/github/kibana/x-pack/test/functional/fixtures/kbn_archiver/canvas/default.json\r\n
│ info deleting 1 objects { space: undefined }\r\n │ succ 1 saved
objects deleted\r\n └-> \"after all\" hook: afterTestSuite.trigger for
\"shows autocomplete when typing\"\r\n │ERROR Browser window is already
closed\r\n └-> \"after all\" hook in \"Canvas app\"\r\n │ debg set roles
= superuser\r\n │ debg creating user test_user\r\n │ debg created user
test_user\r\n └-> \"after all\" hook: afterTestSuite.trigger in \"Canvas
app\"\r\n │ERROR Browser window is already closed\r\n └-> \"after all\"
hook: afterTestSuite.trigger in \"Canvas\"\r\n │ERROR Browser window is
already closed\r\n\r\n5 passing (17.0s)\r\n1 failing\r\n\r\n1)
Canvas\r\n Canvas app\r\n expression editor\r\n shows autocomplete when
typing:\r\n\r\n Error: WebDriver session is invalid, retry was
aborted\r\n at retryForSuccess (retry_for_success.ts:64:13)\r\n at
RetryService.try (retry.ts:31:12)\r\n at
MonacoEditorService.getCodeEditorValue (monaco_editor.ts:25:5)\r\n at
Context.<anonymous> (expression.ts:83:34)\r\n at Object.apply
(wrap_function.js:73:16)\r\n\r\n\r\n```","sha":"f9a4962b4802a520bd7ab3788138cd1c75e7de3a"}}]}]
BACKPORT-->

Co-authored-by: Dzmitry Lemechko <[email protected]>
jloleysens added a commit that referenced this pull request Jan 4, 2024
* main: (4129 commits)
  [Logs Explorer] Change the default link for "Discover" in the serverless nav (#173420)
  [Fleet] fix unhandled error in agent details when components are missing (#174152)
  [Obs UX] Unskip transaction duration alerts test (#174069)
  [Fleet] Fix keep policies up to date after package install (#174093)
  [Profiling] Stack traces embeddable (#173905)
  [main] Sync bundled packages with Package Storage (#174115)
  [SLO Form] Refactor to use kibana data view component (#173513)
  [Obs UX] Unskip APM Service Inventory Journey (#173510)
  [Obs UX] Unskip preview_chart_error_count test (#173624)
  [api-docs] 2024-01-03 Daily api_docs build (#174142)
  Update babel runtime helpers (#171745)
  Handle content stream errors in report pre-deletion (#173792)
  [Cloud Posture] [Quick wins] Enable edit DataView on the Misconfigurations Findings Table (#173870)
  [ftr] abort retry on invalid webdriver session (#174092)
  Upgrade openai to 4.24.1 (#173934)
  chore(NA): bump node into v20 (#173461)
  [Security Solution][Endpoint] Fix index name pattern in SentinelOne dev. script (#174105)
  fix versions.json
  [Obs AI Assistant] Add guardrails (#174060)
  [ML] Transforms: Refactor validators and add unit tests. (#173736)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes v8.12.0 v8.12.1 v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants