mirror of
https://github.com/moby/moby.git
synced 2026-01-11 10:41:43 +00:00
client: TestTLSCloseWriter: cancel context after test
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
@@ -17,6 +18,8 @@ import (
|
||||
|
||||
func TestTLSCloseWriter(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx, cancel := context.WithCancel(t.Context())
|
||||
defer cancel()
|
||||
|
||||
var chErr chan error
|
||||
ts := &httptest.Server{Config: &http.Server{
|
||||
@@ -88,7 +91,7 @@ func TestTLSCloseWriter(t *testing.T) {
|
||||
client, err := New(WithHost("tcp://"+serverURL.Host), WithHTTPClient(ts.Client()))
|
||||
assert.NilError(t, err)
|
||||
|
||||
resp, err := client.postHijacked(t.Context(), "/asdf", url.Values{}, nil, map[string][]string{"Content-Type": {"text/plain"}})
|
||||
resp, err := client.postHijacked(ctx, "/asdf", url.Values{}, nil, map[string][]string{"Content-Type": {"text/plain"}})
|
||||
assert.NilError(t, err)
|
||||
defer resp.Close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user