Skip to content

Commit 7ca9edc

Browse files
author
Ben Reed
committed
Add flag -testTimeout to service with 15m default
The flag -testTimeout specifies the maximum duration a session can take to provision resources and run a test. If this duration is exceeded, the session is killed and an error is returned.
1 parent 7123f78 commit 7ca9edc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

testctrl/cmd/svc/main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ func setupDevEnv(grpcServer *grpc.Server) *kubernetes.Clientset {
6565

6666
func main() {
6767
port := flag.Int("port", 50051, "Port to start the service.")
68+
testTimeout := flag.Duration("testTimeout", 15*time.Minute, "Maximum time tests are allowed to run")
6869
shutdownTimeout := flag.Duration("shutdownTimeout", 5*time.Minute, "Time alloted to a graceful shutdown.")
6970
flag.Parse()
7071
defer glog.Flush()
@@ -83,7 +84,9 @@ func main() {
8384

8485
storageServer := store.NewStorageServer()
8586

86-
controllerOpts := &orch.ControllerOptions{}
87+
controllerOpts := &orch.ControllerOptions{
88+
TestTimeout: *testTimeout,
89+
}
8790
controller, err := orch.NewController(clientset, storageServer, controllerOpts)
8891
if err != nil {
8992
glog.Fatalf("could not create a controller: %v", err)

0 commit comments

Comments
 (0)