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

Handle polly timeout rejected exception for create engine wait #71

Merged
merged 12 commits into from
May 16, 2023

Conversation

NRHelmi
Copy link
Contributor

@NRHelmi NRHelmi commented May 11, 2023

No description provided.

@NRHelmi NRHelmi marked this pull request as ready for review May 11, 2023 13:01
@NRHelmi NRHelmi requested a review from torkins May 11, 2023 13:01
@torkins
Copy link
Collaborator

torkins commented May 15, 2023

Please add to description a step-by-step of what Was happening to cause the intermittent failure and the new step-by-step of what will happen instead

@NRHelmi
Copy link
Contributor Author

NRHelmi commented May 15, 2023

Please add to description a step-by-step of what Was happening to cause the intermittent failure and the new step-by-step of what will happen instead

Tests use EngineFixture to handle engine creation, the EngineFixture is shared between test classes using the ICollectionFixture the same way as it is described in xunit shared context between tests documentation

The issue is happening this way:

  • One test locks the engine creation and attempts to create a new engine if _engine field from the EngineFixture class is null
  • The engine creation times out and the test fails and unlocks the engine creation handler (at this level the engine is in PROVISIONING state)
  • Another test locks the engine creation handler and attempts to create a new engine cause _engine field from the EngineFixture class is still null: the test calls Client.CreateEngineWaitAsync while the engine is in PROVISIONING state and fails.
  • The other tests fail in the same way with this message: Conflict: engine already exists.

Instead we edited the EngineFixture to check if the engine exists or not:

  • If the engine exists and is in PROVISIONED state, the test will use this engine.
  • If the engine exists and the state is not PROVISONED the test will fail with an EngineProvisionFailedException.
  • If the engine doesn't exist, the test will try to create a new engine the same way it was handled before.

@NRHelmi NRHelmi merged commit ec780ad into main May 16, 2023
@NRHelmi NRHelmi deleted the hnr-rai-11237 branch May 16, 2023 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants