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

increasing timeout for GameServerBuild controller test #99

Merged
merged 2 commits into from
Dec 13, 2021
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
10 changes: 8 additions & 2 deletions operator/controllers/gameserverbuild_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package controllers
import (
"context"
"os"
"time"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
Expand All @@ -14,6 +15,11 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
)

const (
assertPollingInterval = 20 * time.Millisecond
assertTimeout = 2 * time.Second
)

var _ = Describe("GameServerBuild controller tests", func() {
Context("testing creating a gameserverbuild creates game servers", func() {
ctx := context.Background()
Expand Down Expand Up @@ -189,7 +195,7 @@ func verifyThatBuildIsUnhealthy(ctx context.Context, buildName string) {
err := k8sClient.Get(ctx, types.NamespacedName{Name: buildName, Namespace: testnamespace}, &gameServerBuild)
Expect(err).ShouldNot(HaveOccurred())
return gameServerBuild.Status.Health == mpsv1alpha1.BuildUnhealthy
})
}, assertTimeout, assertPollingInterval).Should(BeTrue())
}

func waitTillCountGameServersAreInitializing(ctx context.Context, buildID string, count int) {
Expand All @@ -205,7 +211,7 @@ func waitTillCountGameServersAreInitializing(ctx context.Context, buildID string
}
}
return initializingCount == count
}).Should(BeTrue())
}, assertTimeout, assertPollingInterval).Should(BeTrue())
}

func terminateActiveSession(ctx context.Context, buildID string, gracefulTermination bool) {
Expand Down