Skip to content

Commit

Permalink
more retries for TestFlyLaunch_case09
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdfly committed Jun 3, 2023
1 parent 8b449b1 commit ab504a0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/preflight/fly_launch_test.go
Expand Up @@ -7,6 +7,7 @@ import (
"testing"
"time"

"github.com/jpillora/backoff"
"github.com/samber/lo"
"github.com/stretchr/testify/require"
"github.com/superfly/flyctl/api"
Expand Down Expand Up @@ -299,6 +300,11 @@ func TestFlyLaunch_case09(t *testing.T) {
f.Fly("launch --now --copy-config -o %s --name %s --region %s --force-machines", f.OrgSlug(), appName, f.PrimaryRegion())
time.Sleep(500 * time.Millisecond)
ml := f.MachinesList(appName)
b := &backoff.Backoff{Factor: 2, Jitter: true, Min: 100 * time.Millisecond, Max: 3 * time.Second}
for i := 0; len(ml) < 5 || i < 5; i++ {
time.Sleep(b.Duration())
ml = f.MachinesList(appName)
}
require.Equal(f, 5, len(ml), "want 5 machines, which includes two standbys")
groups := lo.GroupBy(ml, func(m *api.Machine) string {
return m.ProcessGroup()
Expand Down

0 comments on commit ab504a0

Please sign in to comment.