ID-925 Fix register-user integration test flakiness. #1246
Merged
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.
https://broadworkbench.atlassian.net/browse/ID-925
The register-user ui integration test is being flakey and I think that the registration flow in orchestration that we changes recently is the cause. In a for yield, futures run concurrently and not necessarily in order unless they depend on results from eachother. So I think what is happening is that sometimes the register request to sam finishes before the rest but when it doesnt we get an error from thurloe and the test fails. By awaiting the sam registration call we make sure it finishes first.
I think this is probably affecting users in production that are trying to register, hard to say how many are actually hitting this.
It is generally good to avoid awaiting futures, but in this case i think it makes sense, register user isnt a high volume endpoint so I am not worried about the marginal performance loss. An alternative is to do future.onSuccess or something but I like the simplicity and straightforward nature of the await here.
Have you read CONTRIBUTING.md lately? If not, do that first.
I, the developer opening this PR, do solemnly pinky swear that:
In all cases: