Skip to content

Commit

Permalink
[WIP] fix gracefulshutdown_test.go logic
Browse files Browse the repository at this point in the history
  • Loading branch information
norbjd committed Apr 7, 2024
1 parent 8099a30 commit 77b783e
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions test/gracefulshutdown/gracefulshutdown_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ package gracefulshutdown
import (
"context"
"fmt"
"log"
"net/http"
"os"
"testing"
Expand Down Expand Up @@ -94,9 +93,7 @@ func TestGracefulShutdown(t *testing.T) {
resp, err := client.Do(req)
defer resp.Body.Close()

Check failure on line 94 in test/gracefulshutdown/gracefulshutdown_test.go

View workflow job for this annotation

GitHub Actions / style / Golang / Lint

httpresponse: using resp before checking for errors (govet)

log.Printf("req err: %+v\n", err)

if err != nil {
if err == nil {
statusCode = resp.StatusCode
}

Expand All @@ -109,14 +106,10 @@ func TestGracefulShutdown(t *testing.T) {
t.Fatalf("Failed to delete pod %s: %v", gatewayPodName, err)
}

log.Println("A")

err = <-errs
if err != nil {
t.Fatal(err)
}

log.Println("B")

assert.Equal(t, statusCode, http.StatusOK)
}

0 comments on commit 77b783e

Please sign in to comment.