Skip to content

Commit

Permalink
Skipped sleep in VCR replaying mode (#12785)
Browse files Browse the repository at this point in the history
[upstream:88e529230a7fa7f13f618e78ddf08782f1ec7a8c]

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician committed Jan 24, 2025
1 parent 32429b7 commit cc1f746
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/12785.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:none

```
5 changes: 5 additions & 0 deletions google/acctest/resource_test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"context"
"errors"
"fmt"
"os"
"slices"
"testing"
"time"
Expand Down Expand Up @@ -92,6 +93,10 @@ func SkipIfVcr(t *testing.T) {

func SleepInSecondsForTest(t int) resource.TestCheckFunc {
return func(s *terraform.State) error {
// Assume we never want to sleep when we're in replaying mode.
if IsVcrEnabled() && os.Getenv("VCR_MODE") == "REPLAYING" {
return nil
}
time.Sleep(time.Duration(t) * time.Second)
return nil
}
Expand Down

0 comments on commit cc1f746

Please sign in to comment.