Skip to content

Commit

Permalink
httptransport: fix test log panic
Browse files Browse the repository at this point in the history
Saw this test log with an unparented context, this should fix it.

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
  • Loading branch information
hdonnay committed Jul 22, 2022
1 parent b8882f9 commit fa49078
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion httptransport/concurrentlimit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestConcurrentRequests(t *testing.T) {
ret, ready := make(chan struct{}), make(chan struct{})
ct := new(int64)
var once sync.Once
srv := httptest.NewServer(&limitHandler{
srv := httptest.NewUnstartedServer(&limitHandler{
Check: func(_ *http.Request) (*semaphore.Weighted, string) {
return sem, ""
},
Expand All @@ -34,6 +34,7 @@ func TestConcurrentRequests(t *testing.T) {
}),
})
srv.Config.BaseContext = func(_ net.Listener) context.Context { return ctx }
srv.Start()
defer srv.Close()
c := srv.Client()

Expand Down

0 comments on commit fa49078

Please sign in to comment.