diff --git a/pkg/gameservers/migration_test.go b/pkg/gameservers/migration_test.go index 2c778d22e3..011fed4908 100644 --- a/pkg/gameservers/migration_test.go +++ b/pkg/gameservers/migration_test.go @@ -22,6 +22,7 @@ import ( agtesting "agones.dev/agones/pkg/testing" "github.com/heptiolabs/healthcheck" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -72,7 +73,7 @@ func TestMigrationControllerIsRunningGameServer(t *testing.T) { gs.ApplyDefaults() gsPod, err := gs.Pod() - assert.NoError(t, err) + require.NoError(t, err) pod := v.setup(gsPod) assert.Equal(t, v.expected, isActiveGameServerWithNode(pod)) @@ -198,8 +199,8 @@ func TestMigrationControllerSyncGameServer(t *testing.T) { gs.ApplyDefaults() pod, err := gs.Pod() + require.NoError(t, err) pod.Spec.NodeName = nodeFixtureName - assert.NoError(t, err) node := &corev1.Node{ObjectMeta: metav1.ObjectMeta{Name: nodeFixtureName}, Status: corev1.NodeStatus{Addresses: []corev1.NodeAddress{{Address: ipFixture, Type: corev1.NodeExternalIP}}}} @@ -246,8 +247,8 @@ func TestMigrationControllerRun(t *testing.T) { Spec: newSingleContainerSpec(), Status: agonesv1.GameServerStatus{}} gs.ApplyDefaults() gsPod, err := gs.Pod() + require.NoError(t, err) gsPod.Spec.NodeName = nodeFixtureName - assert.NoError(t, err) received := make(chan string) h := func(name string) error { diff --git a/pkg/gameservers/pernodecounter_test.go b/pkg/gameservers/pernodecounter_test.go index 25ff35a282..a29a295a05 100644 --- a/pkg/gameservers/pernodecounter_test.go +++ b/pkg/gameservers/pernodecounter_test.go @@ -20,6 +20,7 @@ import ( agonesv1 "agones.dev/agones/pkg/apis/agones/v1" agtesting "agones.dev/agones/pkg/testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -65,7 +66,7 @@ func TestPerNodeCounterGameServerEvents(t *testing.T) { cache.WaitForCacheSync(stop, hasSynced) counts := pnc.Counts() - assert.Len(t, counts, 1) + require.Len(t, counts, 1) assert.Equal(t, int64(1), counts[name1].Ready) assert.Equal(t, int64(0), counts[name1].Allocated) @@ -74,7 +75,7 @@ func TestPerNodeCounterGameServerEvents(t *testing.T) { cache.WaitForCacheSync(stop, hasSynced) counts = pnc.Counts() - assert.Len(t, counts, 1) + require.Len(t, counts, 1) assert.Equal(t, int64(0), counts[name1].Ready) assert.Equal(t, int64(1), counts[name1].Allocated) @@ -83,7 +84,7 @@ func TestPerNodeCounterGameServerEvents(t *testing.T) { cache.WaitForCacheSync(stop, hasSynced) counts = pnc.Counts() - assert.Len(t, counts, 1) + require.Len(t, counts, 1) assert.Equal(t, int64(0), counts[name1].Ready) assert.Equal(t, int64(0), counts[name1].Allocated) @@ -95,7 +96,7 @@ func TestPerNodeCounterGameServerEvents(t *testing.T) { cache.WaitForCacheSync(stop, hasSynced) counts = pnc.Counts() - assert.Len(t, counts, 2) + require.Len(t, counts, 2) assert.Equal(t, int64(0), counts[name1].Ready) assert.Equal(t, int64(0), counts[name1].Allocated) assert.Equal(t, int64(1), counts[name2].Ready) @@ -110,7 +111,7 @@ func TestPerNodeCounterGameServerEvents(t *testing.T) { cache.WaitForCacheSync(stop, hasSynced) counts = pnc.Counts() - assert.Len(t, counts, 2) + require.Len(t, counts, 2) assert.Equal(t, int64(0), counts[name1].Ready) assert.Equal(t, int64(0), counts[name1].Allocated) assert.Equal(t, int64(1), counts[name2].Ready) @@ -185,7 +186,7 @@ func TestPerNodeCounterRun(t *testing.T) { counts := pnc.Counts() - assert.Len(t, counts, 2) + require.Len(t, counts, 2) assert.Equal(t, int64(1), counts[name1].Ready) assert.Equal(t, int64(2), counts[name1].Allocated) assert.Equal(t, int64(0), counts[name2].Ready)