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

Skipped sleep in VCR replaying mode #21033

Conversation

modular-magician
Copy link
Collaborator

In SleepInSecondsForTest(), skip the sleep when VCR_MODE is REPLAYING. This makes the assumption that the sleep is always related to a condition that's already mitigated by the fact that we're using prerecorded fixtures, but it could be extended later to override this behavior if necessary.

Fixes #20916

Replaying mode with change:

--- PASS: TestAccResourceGoogleProjectDefaultServiceAccountsDisable (24.32s)
PASS
ok  	github.com/hashicorp/terraform-provider-google/google/services/resourcemanager	25.464s

without change (this one has a 5s sleep, so the difference is small, but you can see it more dramatically on something with a longer sleep)

--- PASS: TestAccResourceGoogleProjectDefaultServiceAccountsDisable (29.51s)
PASS
ok  	github.com/hashicorp/terraform-provider-google/google/services/resourcemanager	30.720s

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.


Derived from GoogleCloudPlatform/magic-modules#12785

[upstream:88e529230a7fa7f13f618e78ddf08782f1ec7a8c]

Signed-off-by: Modular Magician <[email protected]>
@modular-magician modular-magician requested a review from a team as a code owner January 24, 2025 16:35
@modular-magician modular-magician merged commit cb9f05c into hashicorp:main Jan 24, 2025
4 checks passed
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.

Sleep statement in tests with VCR enabled
1 participant