Skip to content

Commit

Permalink
Fix for flaky TestFleetRecreateGameServers (googleforgames#2535)
Browse files Browse the repository at this point in the history
If the returned packet gets dropped somewhere, we can confirm if it's
still a valid test, as if the `GameServer` is gone, we're in a good
place.

Closes googleforgames#2479

Co-authored-by: Robert Bailey <robertbailey@google.com>
  • Loading branch information
2 people authored and Thiryn committed Apr 25, 2022
1 parent 518f94c commit ab25233
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/e2e/fleet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,12 @@ func TestFleetRecreateGameServers(t *testing.T) {
var reply string
reply, err := framework.SendGameServerUDP(t, &gs, "EXIT")
if err != nil {
t.Fatalf("Could not message GameServer: %v", err)
// if we didn't get a response because the GameServer has gone away, then the packet dropped on the return,
// but we're in the state we want, so we can ignore that we didn't get a response.
_, gsErr := framework.AgonesClient.AgonesV1().GameServers(gs.ObjectMeta.Namespace).Get(ctx, gs.ObjectMeta.Name, metav1.GetOptions{})
if !k8serrors.IsNotFound(gsErr) {
t.Fatalf("Could not message GameServer: %v", err)
}
}

assert.Equal(t, "ACK: EXIT\n", reply)
Expand Down

0 comments on commit ab25233

Please sign in to comment.