Skip to content

Commit

Permalink
RHOAIENG-15772: tests(odh-nbc): disable graceful shutdown period for …
Browse files Browse the repository at this point in the history
…envtest (#464)

* RHOAIENG-15772: tests(odh-nbc): disable graceful shutdown period for envtest

There is no benefit to doing graceful shutdown. We don't assert anything about the shutdown process, so it is best to be done with it quickly, so that we don't waste time and also avoid some meaningless log messages the shutdown may print out.

* fixup also pass in test context
  • Loading branch information
jiridanek authored Nov 19, 2024
1 parent 658c81d commit 9e32dfd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions components/odh-notebook-controller/controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"crypto/tls"
"fmt"
"k8s.io/utils/ptr"
"net"
"path/filepath"
"testing"
Expand Down Expand Up @@ -127,6 +128,12 @@ var _ = BeforeSuite(func() {
Port: webhookInstallOptions.LocalServingPort,
CertDir: webhookInstallOptions.LocalServingCertDir,
}),
// Issue#429: waiting in tests only wastes time and prints pointless context-cancelled errors
GracefulShutdownTimeout: ptr.To(time.Duration(0)),
// pass in test context because why not
BaseContext: func() context.Context {
return ctx
},
})
Expect(err).NotTo(HaveOccurred())

Expand Down

0 comments on commit 9e32dfd

Please sign in to comment.