@@ -617,7 +617,10 @@ func runStreamingCompletion(prompt string, theModel openai.CompletionNewParamsMo
617617
618618 resp , err := http .DefaultClient .Do (req )
619619 gomega .Expect (err ).ShouldNot (gomega .HaveOccurred ())
620- defer resp .Body .Close ()
620+ defer func () {
621+ err := resp .Body .Close ()
622+ gomega .Expect (err ).ToNot (gomega .HaveOccurred ())
623+ }()
621624
622625 gomega .Expect (resp .StatusCode ).Should (gomega .Equal (http .StatusOK ))
623626
@@ -644,7 +647,10 @@ func runStreamingChatCompletion(prompt string) (string, string) {
644647
645648 resp , err := http .DefaultClient .Do (req )
646649 gomega .Expect (err ).ShouldNot (gomega .HaveOccurred ())
647- defer resp .Body .Close ()
650+ defer func () {
651+ err := resp .Body .Close ()
652+ gomega .Expect (err ).ToNot (gomega .HaveOccurred ())
653+ }()
648654
649655 gomega .Expect (resp .StatusCode ).Should (gomega .Equal (http .StatusOK ))
650656
@@ -678,7 +684,10 @@ func runCompletionWithCacheThreshold(prompt string, cacheHitThreshold float64, f
678684
679685 resp , err := http .DefaultClient .Do (req )
680686 gomega .Expect (err ).ShouldNot (gomega .HaveOccurred ())
681- defer resp .Body .Close ()
687+ defer func () {
688+ err := resp .Body .Close ()
689+ gomega .Expect (err ).ToNot (gomega .HaveOccurred ())
690+ }()
682691
683692 gomega .Expect (resp .StatusCode ).Should (gomega .Equal (http .StatusOK ))
684693
@@ -712,7 +721,10 @@ func runStreamingCompletionWithCacheThreshold(prompt string, cacheHitThreshold f
712721
713722 resp , err := http .DefaultClient .Do (req )
714723 gomega .Expect (err ).ShouldNot (gomega .HaveOccurred ())
715- defer resp .Body .Close ()
724+ defer func () {
725+ err := resp .Body .Close ()
726+ gomega .Expect (err ).ToNot (gomega .HaveOccurred ())
727+ }()
716728
717729 gomega .Expect (resp .StatusCode ).Should (gomega .Equal (http .StatusOK ))
718730
@@ -768,7 +780,7 @@ func extractFinishReasonFromStreaming(sseData string) string {
768780// getPrefillRequestCount gets the total request count from a prefill pod's metrics endpoint.
769781// This is used to verify whether a request was processed by the prefill pod.
770782func getPrefillRequestCount (prefillPodName string ) int {
771- ginkgo .By (fmt . Sprintf ( "Getting request count from prefill pod: %s" , prefillPodName ) )
783+ ginkgo .By ("Getting request count from prefill pod: " + prefillPodName )
772784
773785 // Use Kubernetes API proxy to access the metrics endpoint
774786 output , err := testConfig .KubeCli .CoreV1 ().RESTClient ().
0 commit comments