Skip to content

[8.x] [kbn-test] add forceNewSession option to re-generate session cookie (#199018)#204583

Merged
stephmilovic merged 1 commit intoelastic:8.xfrom
dmlemeshko:backport/8.x/pr-199018
Dec 18, 2024
Merged

[8.x] [kbn-test] add forceNewSession option to re-generate session cookie (#199018)#204583
stephmilovic merged 1 commit intoelastic:8.xfrom
dmlemeshko:backport/8.x/pr-199018

Conversation

@dmlemeshko
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

@dmlemeshko dmlemeshko added the backport This PR is a backport of another PR label Dec 17, 2024
@dmlemeshko dmlemeshko enabled auto-merge (squash) December 17, 2024 14:52
@kapral18
Copy link
Copy Markdown
Contributor

Please do not merge this pull request. We disabled auto-merge because we are trying to merge a this big PR as part of sustainable architecture migration which is impossible with ever increasing stream of backports. We will resume the automerge after our PR is merged. Reach out to #sustainable-kibana-architecture for more info.

@kapral18 kapral18 disabled auto-merge December 17, 2024 16:38
@kapral18
Copy link
Copy Markdown
Contributor

Auto-merge has been re-enabled. Thank you for your patience. :heart

@stephmilovic stephmilovic enabled auto-merge (squash) December 17, 2024 19:33
…lastic#199018)

## Summary

Currently FTR caches `Cookies` of Cloud SAML sessions for the complete
FTR config run, meaning we only perform actual login once for the
specified role. It helps to optimise tests run time and improve
stability.

While it works most of the time, according to
https://github.com/elastic/kibana/issues/71866 Reporting test suite
stability depends on token validity (`20m`) and to stabilize it, this PR
adds `forceNewSession` option to force request a new SAML session when
it is required for specific tests.

```
      cookieCredentials = await samlAuth.getM2MApiCookieCredentialsWithRoleScope('admin', {
        forceNewSession: true,
      });
```

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 7608d76)

# Conflicts:
#	packages/kbn-test/index.ts
#	x-pack/test_serverless/api_integration/test_suites/common/reporting/datastream.ts
#	x-pack/test_serverless/api_integration/test_suites/common/reporting/generate_csv_discover.ts
@dmlemeshko dmlemeshko force-pushed the backport/8.x/pr-199018 branch from fc99dd8 to eef56e9 Compare December 18, 2024 13:03
@dmlemeshko dmlemeshko requested a review from pheyos December 18, 2024 13:53
@stephmilovic stephmilovic merged commit be3b97d into elastic:8.x Dec 18, 2024
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/test 296 300 +4
Unknown metric groups

API count

id before after diff
@kbn/test 351 355 +4

History

  • 💔 Build #261725 failed fc99dd83a0f2e2ebd03046a9aa468c225ae76b6f
  • 💔 Build #261683 failed 2e1f819ee1164b08a93463dc61a9dc0e6df8027c
  • 💔 Build #261666 failed 117fec84a5932ecbc6d3c464372b8d56a80c381a
  • 💔 Build #261458 failed ff0f066970d0517c7de1ce1e3006eb5ab359ee62
  • 💔 Build #261434 failed c15ac2e52b07a614e217e342177ef1a02b564b05

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

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants