Skip to content

Commit

Permalink
[WIP] use initialTimeout + debug
Browse files Browse the repository at this point in the history
  • Loading branch information
norbjd committed Apr 7, 2024
1 parent 00b30cd commit 8099a30
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/gracefulshutdown/gracefulshutdown_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ package gracefulshutdown
import (
"context"
"fmt"
"log"
"net/http"
"os"
"testing"
Expand Down Expand Up @@ -81,7 +82,7 @@ func TestGracefulShutdown(t *testing.T) {

var statusCode int

reqURL := fmt.Sprintf("http://%s.example.com?timeout=%d", name, delay.Milliseconds())
reqURL := fmt.Sprintf("http://%s.example.com?initialTimeout=%d", name, delay.Milliseconds())
req, err := http.NewRequest("GET", reqURL, nil)
if err != nil {
t.Fatal("Error making GET request:", err)
Expand All @@ -93,6 +94,8 @@ func TestGracefulShutdown(t *testing.T) {
resp, err := client.Do(req)
defer resp.Body.Close()

Check failure on line 95 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 {
statusCode = resp.StatusCode
}
Expand All @@ -106,10 +109,14 @@ 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 8099a30

Please sign in to comment.