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

Check for Vault API to be ready in Vault tests #21154

Merged
merged 1 commit into from
Nov 3, 2021
Merged

Check for Vault API to be ready in Vault tests #21154

merged 1 commit into from
Nov 3, 2021

Conversation

vsevel
Copy link
Contributor

@vsevel vsevel commented Nov 2, 2021

Waiting for the container to start is not enough to be able to initialize the vault instance. We need to check that the API is ready as well.
In a slow environment, if we don't, we can get a read timeout on the first http request. Most likely vault has received it and processed it, but for some reason the client (i.e. vault test) does not receive the response. It is not clear why this happens. But to make tests more resilient we need to exercise the API before executing non idempotent calls. This can't be the init(int,int) service, because as soon as the vault is initialized, it cannot be reinitialized (if the first call went through), and the test cannot continue without the root token and unseal keys that come from the init call.
This fix consists in trying out multiple times executing sys/seal-status until we get a valid response. Once this is done, we can continue the normal flow of vault initialization.
Also changed the idle timeout to be 2 times the read timeout, otherwise we risk closing the connection before the atMost throws a timeout exception.
Fixes #21095
With that we should not need anymore the increases read and connect timeouts that have been tried earlier to try fixing this issue.

@geoand geoand merged commit 899fa20 into quarkusio:main Nov 3, 2021
@quarkus-bot quarkus-bot bot added this to the 2.5 - main milestone Nov 3, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Nov 3, 2021

Milestone is already set for some of the items:

We haven't automatically updated the milestones for these items.

This message is automatically generated by a bot.

@gsmet gsmet modified the milestones: 2.5.0.CR1, 2.4.2.Final Nov 11, 2021
@vsevel vsevel deleted the vault_test_init branch February 23, 2023 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vault tests are flaky
3 participants