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

Fix tests to use dedicated bootstrapped service accounts instead of one shared account #17873

Conversation

modular-magician
Copy link
Collaborator

Fixes #16247

Previously, one shared service account was bootstrapped and reused for at least 2 of these tests. During the bootstrap, which is called on every VCR run, the policy on the service account was designed to be overwritten (to control for drift). However, overwriting the policy is a read-modify-write operation that cannot be done concurrently. This creates a race condition when the bootstrap functions are run at the same time, which seems to be more common in the VCR case.

The solution chosen here is to create a separate service account per-test. Service accounts are cheap, there are only 5 such uses for them so far, and this allows us to enforce the policy on every run the way we do now. Since the accounts are isolated per-test, they can still be bootstrapped ahead of time, while not running into concurrency issues.

Release Note Template for Downstream PRs (will be copied)


Derived from GoogleCloudPlatform/magic-modules#10418

…ne shared account (hashicorp#10418)

[upstream:7041d8052bd61acf8a05feb51cdccf950ff072e6]

Signed-off-by: Modular Magician <[email protected]>
@modular-magician modular-magician merged commit 691c9ee into hashicorp:main Apr 16, 2024
4 checks passed
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 18, 2024
@modular-magician modular-magician deleted the downstream-pr-7041d8052bd61acf8a05feb51cdccf950ff072e6 branch November 17, 2024 00:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failing VCR test(s): TestAccDataSourceGoogleServiceAccount*Token_*
1 participant