Skip to content

Commit

Permalink
Use require.Eventually instead of require.EventuallyWithT
Browse files Browse the repository at this point in the history
It seems that some assertions will call `FailNow()` which panics when called on `assert.CollectT`.

See:
- stretchr/testify#1396
- stretchr/testify#1457
  • Loading branch information
michaeldwan committed Aug 29, 2023
1 parent 47a9462 commit b3af6e2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/preflight/apps_v2_integration_test.go
Expand Up @@ -39,10 +39,9 @@ func TestAppsV2Example(t *testing.T) {
require.Contains(f, result.StdOutString(), fmt.Sprintf("Created app '%s' in organization '%s'", appName, f.OrgSlug()))
require.Contains(f, result.StdOutString(), "Wrote config file fly.toml")

require.EventuallyWithT(t, func(c *assert.CollectT) {
require.Eventually(t, func() bool {
resp, err := http.Get(appUrl)
assert.NoError(c, err)
assert.Equal(c, http.StatusOK, resp.StatusCode)
return err == nil && resp.StatusCode == http.StatusOK
}, 20*time.Second, 1*time.Second, "GET %s never returned 200 OK response 20 seconds", appUrl)

machList := f.MachinesList(appName)
Expand Down

0 comments on commit b3af6e2

Please sign in to comment.