Skip to content

Commit

Permalink
Merge branch 'main' into arbitrary-counts-lists-2716
Browse files Browse the repository at this point in the history
  • Loading branch information
markmandel authored Sep 12, 2023
2 parents c834a24 + 0e62bc5 commit a1b82a7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/e2e/gameserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"net"
"os"
"os/exec"
"sort"
"strings"
"sync/atomic"
"testing"
Expand Down Expand Up @@ -925,7 +926,6 @@ func TestGameServerWithoutPort(t *testing.T) {
func TestGameServerResourceValidation(t *testing.T) {
t.Parallel()
ctx := context.Background()
logger := e2eframework.TestLogger(t)
gs := framework.DefaultGameServer(framework.Namespace)
mi64 := resource.MustParse("64Mi")
gs.Spec.Template.Spec.Containers[0].Resources.Limits[corev1.ResourceMemory] = mi64
Expand All @@ -949,8 +949,10 @@ func TestGameServerResourceValidation(t *testing.T) {
assert.NotNil(t, err)
statusErr, ok = err.(*k8serrors.StatusError)
assert.True(t, ok)
logger.Debug("TestGameServerResourceValidation gsClient.Create with negative resource status errors: ", statusErr)
assert.Len(t, statusErr.Status().Details.Causes, 2)
sort.Slice(statusErr.Status().Details.Causes, func(i, j int) bool {
return statusErr.Status().Details.Causes[i].Field > statusErr.Status().Details.Causes[j].Field
})
assert.Equal(t, metav1.CauseTypeFieldValueInvalid, statusErr.Status().Details.Causes[0].Type)
assert.Equal(t, "spec.template.spec.containers[0].resources.requests[cpu]", statusErr.Status().Details.Causes[0].Field)

Expand Down

0 comments on commit a1b82a7

Please sign in to comment.