Skip to content

Commit

Permalink
Deflake test (#4680) (#3154)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored Apr 14, 2021
1 parent 50178c3 commit db911ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .changelog/4680.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:none

```
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,12 @@ func testAccCheckServiceUsageConsumerQuotaOverrideDestroyProducer(t *testing.T)
billingProject = config.BillingProject
}

_, err = sendRequest(config, "GET", billingProject, url, config.userAgent, nil)
res, err := sendRequest(config, "GET", billingProject, url, config.userAgent, nil)
if err == nil {
return fmt.Errorf("ServiceUsageConsumerQuotaOverride still exists at %s", url)
// Sometimes the API returns an empty response instead of erroring, treat empty as nonexistent
if len(res) != 0 {
return fmt.Errorf("ServiceUsageConsumerQuotaOverride still exists at %s", url)
}
}
}

Expand Down

0 comments on commit db911ca

Please sign in to comment.