Handle expired tokens in cluster migration tests#89422
Merged
n1v0lg merged 29 commits intoelastic:mainfrom Aug 23, 2022
Merged
Conversation
n1v0lg
commented
Aug 22, 2022
| assertEquals(false, bulkResponseMap.get("errors")); | ||
| } | ||
|
|
||
| private void refreshSecurityTokensIndex() throws IOException { |
Contributor
Author
There was a problem hiding this comment.
This may be overkill but I want to avoid weird flakiness here -- it would take forever to debug for someone looking at this in the future.
Contributor
Author
|
@elasticsearchmachine update branch plz |
Contributor
Author
|
@elasticsearchmachine run elasticsearch-ci/part-2 |
Collaborator
|
Pinging @elastic/es-security (Team:Security) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses a failure around token BWC during cluster upgrade
tests: the tests assert that tokens created in a cluster before (or
during) an upgrade are still valid in the mixed or upgraded clusters.
Our cluster upgrade test suites are long running however such that
tokens created in the old (or mixed) cluster may be expired by the time
we test their validity. The maximum lifetime of tokens is configured
via a setting which has a max value of 1h. This PR extends the lifetime
of all tokens by writing to the
.security-tokensindex directly, foreach test where this is necessary. This (hacky) solution allows us to
robustly exercise the target path of the test (validating that a token
is valid and authenticates correctly) while keeping the fix confined to
test code (as opposed to solving this via a system property).
Closes #77350