Skip to content

Commit

Permalink
TestFleetRecreateGameServers: Ignore servers in Shutdown (googleforga…
Browse files Browse the repository at this point in the history
…mes#3163)

If game servers are in `Shutdown`, ignore them.
  • Loading branch information
chiayi committed May 19, 2023
1 parent 1a60ca7 commit 84d67bb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/e2e/fleet_test.go
Expand Up @@ -1350,13 +1350,19 @@ func TestFleetRecreateGameServers(t *testing.T) {

list, err := listGameServers(ctx, flt, client)
assert.NoError(t, err)
assert.Len(t, list.Items, int(flt.Spec.Replicas))
var gameservers []agonesv1.GameServer
for _, gs := range list.Items {
if gs.Status.State != agonesv1.GameServerStateShutdown {
gameservers = append(gameservers, gs)
}
}
assert.Len(t, gameservers, int(flt.Spec.Replicas))

// apply deletion function
logrus.Info("applying deletion function")
v.f(t, list)

for i, gs := range list.Items {
for i, gs := range gameservers {
err = wait.Poll(time.Second, 5*time.Minute, func() (done bool, err error) {
_, err = client.GameServers(framework.Namespace).Get(ctx, gs.ObjectMeta.Name, metav1.GetOptions{})

Expand Down

0 comments on commit 84d67bb

Please sign in to comment.