Skip to content

Commit

Permalink
Set timeout and interval to all Eventually tests
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
  • Loading branch information
tenzen-y committed Jul 3, 2023
1 parent b88ed3d commit f3a0d0f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/controller.v1/mpi/mpijob_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package mpi
import (
"context"
"fmt"
"strings"

common "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
. "github.com/onsi/ginkgo/v2"
Expand All @@ -27,7 +28,6 @@ import (
"k8s.io/apimachinery/pkg/types"
"k8s.io/utils/pointer"
ctrl "sigs.k8s.io/controller-runtime"
"strings"

kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
"github.com/kubeflow/training-operator/pkg/util/testutil"
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller.v1/pytorch/pytorchjob_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
)

var _ = Describe("PyTorchJob controller", func() {
// Define utility constants for object names and testing timeouts/durations and intervals.
// Define utility constants for object names.
const (
expectedPort = int32(8080)
)
Expand Down
6 changes: 3 additions & 3 deletions pkg/controller.v1/tensorflow/job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -648,11 +648,11 @@ var _ = Describe("Test for controller.v1/common", func() {
Eventually(func() bool {
gotErr := testK8sClient.Get(ctx, client.ObjectKeyFromObject(tc.tfJob), &kubeflowv1.TFJob{})
return errors.IsNotFound(gotErr)
}).Should(BeTrue())
}, testutil.Timeout, testutil.Interval).Should(BeTrue())
} else {
Eventually(func() error {
return testK8sClient.Get(ctx, client.ObjectKeyFromObject(tc.tfJob), &kubeflowv1.TFJob{})
}).Should(BeNil())
}, testutil.Timeout, testutil.Interval).Should(BeNil())
}
},
Entry("TFJob shouldn't be removed since TTL is nil", &cleanUpCases{
Expand Down Expand Up @@ -766,7 +766,7 @@ var _ = Describe("Test for controller.v1/common", func() {
svc := &corev1.Service{}
Expect(testK8sClient.Get(ctx, client.ObjectKeyFromObject(wantSvc), svc)).Should(Succeed())
return svc
}).Should(BeComparableTo(wantSvc,
}, testutil.Timeout, testutil.Interval).Should(BeComparableTo(wantSvc,
cmpopts.IgnoreFields(metav1.ObjectMeta{}, "UID", "ResourceVersion", "Generation", "CreationTimestamp", "ManagedFields")))
}
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller.v1/tensorflow/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package tensorflow
import (
"context"
"fmt"
"os"

commonv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
. "github.com/onsi/ginkgo/v2"
Expand All @@ -26,7 +27,6 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/uuid"
"os"
"sigs.k8s.io/controller-runtime/pkg/client"

kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/testutil/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ package testutil
import "time"

const (
Timeout = 10 * time.Second
Timeout = 30 * time.Second
Interval = 250 * time.Millisecond
)

0 comments on commit f3a0d0f

Please sign in to comment.