Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestAllocatorAfterDeleteReplica: More logging #3837

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions test/e2e/allocator/pod_termination_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import (
agonesv1 "agones.dev/agones/pkg/apis/agones/v1"
helper "agones.dev/agones/test/e2e/allochelper"
e2e "agones.dev/agones/test/e2e/framework"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"google.golang.org/grpc/status"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/wait"

Expand All @@ -39,13 +39,14 @@ const (

func TestAllocatorAfterDeleteReplica(t *testing.T) {
ctx := context.Background()
logger := e2e.TestLogger(t)

var list *v1.PodList

dep, err := framework.KubeClient.AppsV1().Deployments("agones-system").Get(ctx, "agones-allocator", metav1.GetOptions{})
require.NoError(t, err, "Failed to get replicas")
replicaCnt := int(*(dep.Spec.Replicas))
logrus.Infof("Replica count config is %d", replicaCnt)
logger.Infof("Replica count config is %d", replicaCnt)

// poll and wait until all allocator pods are running
_ = wait.PollUntilContextTimeout(context.Background(), retryInterval, retryTimeout, true, func(ctx context.Context) (done bool, err error) {
Expand All @@ -60,7 +61,7 @@ func TestAllocatorAfterDeleteReplica(t *testing.T) {

for _, allocpod := range list.Items {
podstatus := string(allocpod.Status.Phase)
logrus.Infof("Allocator Pod %s, has status of %s", allocpod.ObjectMeta.Name, podstatus)
logger.Infof("Allocator Pod %s, has status of %s", allocpod.ObjectMeta.Name, podstatus)
if podstatus != "Running" {
return false, nil
}
Expand Down Expand Up @@ -96,7 +97,7 @@ func TestAllocatorAfterDeleteReplica(t *testing.T) {
// Wait and keep making calls till we know the draining time has passed
_ = wait.PollUntilContextTimeout(context.Background(), retryInterval, retryTimeout, true, func(ctx context.Context) (bool, error) {
response, err = grpcClient.Allocate(context.Background(), request)
logrus.Info(response)
logger.Infof("err = %v (code = %v), response = %v", err, status.Code(err), response)
helper.ValidateAllocatorResponse(t, response)
require.NoError(t, err, "Failed grpc allocation request")
err = helper.DeleteAgonesPod(ctx, response.GameServerName, framework.Namespace, framework)
Expand Down
Loading