@@ -26,20 +26,34 @@ import (
2626 "strings"
2727 "time"
2828
29+ "sigs.k8s.io/controller-runtime/pkg/log"
30+ ctrllog "sigs.k8s.io/controller-runtime/pkg/log"
31+ "sigs.k8s.io/controller-runtime/pkg/log/zap"
32+
2933 "github.com/llm-d/llm-d-inference-scheduler/pkg/common"
3034 "github.com/llm-d/llm-d-inference-scheduler/test/sidecar/mock"
3135 . "github.com/onsi/ginkgo/v2" // nolint:revive
3236 . "github.com/onsi/gomega" // nolint:revive
33- "k8s.io/klog/v2/ktesting"
3437)
3538
39+ func newTestContext () context.Context {
40+ logger := zap .New (
41+ zap .WriteTo (GinkgoWriter ),
42+ zap .UseDevMode (true ),
43+ )
44+ ctrllog .SetLogger (logger )
45+ ctx := context .Background ()
46+ log .IntoContext (ctx , logger ) // not strictly needed since we called SetLogger to set default
47+ return ctx
48+ }
49+
3650var _ = Describe ("Reverse Proxy" , func () {
3751 When ("x-prefiller-url is not present" , func () {
3852 DescribeTable ("should forward requests to decode server" ,
3953
4054 func (path string , secureProxy bool ) {
41- _ , ctx := ktesting .NewTestContext (GinkgoT ())
4255
56+ ctx := newTestContext ()
4357 var cert * tls.Certificate
4458 if secureProxy {
4559 tempCert , err := CreateSelfSignedTLSCertificate ()
@@ -159,7 +173,7 @@ var _ = Describe("Reverse Proxy", func() {
159173 })
160174
161175 It ("should successfully send request to 1. prefill 2. decode with the right fields (backward compatible behavior)" , func () {
162- _ , ctx := ktesting . NewTestContext ( GinkgoT () )
176+ ctx := newTestContext ( )
163177 ctx , cancelFn := context .WithCancel (ctx )
164178 stoppedCh := make (chan struct {})
165179
@@ -233,7 +247,7 @@ var _ = Describe("Reverse Proxy", func() {
233247 })
234248
235249 It ("should successfully send request to 1. prefill 2. decode with the right fields" , func () {
236- _ , ctx := ktesting . NewTestContext ( GinkgoT () )
250+ ctx := newTestContext ( )
237251 ctx , cancelFn := context .WithCancel (ctx )
238252 stoppedCh := make (chan struct {})
239253
0 commit comments