Skip to content

Commit

Permalink
revert to PollImmediateUntil
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalaiselvi84 committed Oct 25, 2023
1 parent 2323b11 commit fd48aef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/e2e/framework/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,8 @@ func (f *Framework) WaitForGameServerState(t *testing.T, gs *agonesv1.GameServer
// Each Allocated GameServer gets deleted allocDuration after it was Allocated.
// GameServers will continue to be Allocated until a message is passed to the done channel.
func (f *Framework) CycleAllocations(ctx context.Context, t *testing.T, flt *agonesv1.Fleet, period time.Duration, allocDuration time.Duration) {
err := wait.PollUntilContextCancel(ctx, period, true, func(ctx context.Context) (bool, error) {
// nolint:staticcheck
err := wait.PollImmediateUntil(period, func() (bool, error) {
gsa := GetAllocation(flt)
gsa, err := f.AgonesClient.AllocationV1().GameServerAllocations(flt.Namespace).Create(context.Background(), gsa, metav1.CreateOptions{})
if err != nil || gsa.Status.State != allocationv1.GameServerAllocationAllocated {
Expand All @@ -308,7 +309,7 @@ func (f *Framework) CycleAllocations(ctx context.Context, t *testing.T, flt *ago
}(gsa)

return false, nil
})
}, ctx.Done())
// Ignore wait timeout error, will always be returned when the context is cancelled at the end of the test.
// nolint:staticcheck
if err != wait.ErrWaitTimeout {
Expand Down

0 comments on commit fd48aef

Please sign in to comment.