Fix flaky test of api renewer by moving away from legacy api. #8265
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.
I wasn't able to reproduce this, so it's a speculative fix. An example failure from https://circleci.com/gh/hashicorp/vault/37790?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link looks like
What I think happened is that we renewed successfully at least once, and then due to a slow VM didn't reach https://github.com/hashicorp/vault/blob/master/api/lifetime_watcher.go#L337 (where we'd have exited cleanly) before it encountered a renewal failure here: https://github.com/hashicorp/vault/blob/master/api/lifetime_watcher.go#L286. The newer API doesn't enter that if statement so shouldn't fail this way. I converted the other tests in this file to use the newer API as well because I think it makes more sense to exercise the non-legacy API.