Skip to content

Commit

Permalink
Flaky TestLocal (googleforgames#1665)
Browse files Browse the repository at this point in the history
Fixed an issue with time slipping in this test.
  • Loading branch information
markmandel authored and ilkercelikyilmaz committed Oct 23, 2020
1 parent 1acade0 commit 80b8429
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkg/sdkserver/localsdk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,14 @@ func TestLocal(t *testing.T) {
gs, err := l.GetGameServer(ctx, e)
assert.Nil(t, err)

assert.Equal(t, defaultGs().GetObjectMeta(), gs.GetObjectMeta())
assert.Equal(t, defaultGs().GetSpec(), gs.GetSpec())
gsStatus := defaultGs().GetStatus()
defaultGameServer := defaultGs()
// do this to adjust for any time differences.
// we only care about all the other values to be compared.
defaultGameServer.ObjectMeta.CreationTimestamp = gs.GetObjectMeta().CreationTimestamp

assert.Equal(t, defaultGameServer.GetObjectMeta(), gs.GetObjectMeta())
assert.Equal(t, defaultGameServer.GetSpec(), gs.GetSpec())
gsStatus := defaultGameServer.GetStatus()
gsStatus.State = "Shutdown"
assert.Equal(t, gsStatus, gs.GetStatus())
}
Expand Down

0 comments on commit 80b8429

Please sign in to comment.