pkg/proc,pkg/terminal: close response body in tests (#3372)
This commit is contained in:
parent
84b757ad57
commit
c5d9baaeb6
@ -741,7 +741,10 @@ func TestNextNetHTTP(t *testing.T) {
|
||||
}
|
||||
time.Sleep(50 * time.Millisecond)
|
||||
}
|
||||
http.Get("http://127.0.0.1:9191")
|
||||
resp, err := http.Get("http://127.0.0.1:9191")
|
||||
if err == nil {
|
||||
resp.Body.Close()
|
||||
}
|
||||
}()
|
||||
if err := grp.Continue(); err != nil {
|
||||
t.Fatal(err)
|
||||
@ -2913,7 +2916,10 @@ func TestAttachDetach(t *testing.T) {
|
||||
assertNoError(err, t, "Attach")
|
||||
go func() {
|
||||
time.Sleep(1 * time.Second)
|
||||
http.Get("http://127.0.0.1:9191")
|
||||
resp, err := http.Get("http://127.0.0.1:9191")
|
||||
if err == nil {
|
||||
resp.Body.Close()
|
||||
}
|
||||
}()
|
||||
|
||||
assertNoError(p.Continue(), t, "Continue")
|
||||
|
||||
@ -693,7 +693,10 @@ func TestIssue827(t *testing.T) {
|
||||
withTestTerminal("notify-v2", t, func(term *FakeTerminal) {
|
||||
go func() {
|
||||
time.Sleep(1 * time.Second)
|
||||
http.Get("http://127.0.0.1:8888/test")
|
||||
resp, err := http.Get("http://127.0.0.1:8888/test")
|
||||
if err == nil {
|
||||
resp.Body.Close()
|
||||
}
|
||||
time.Sleep(1 * time.Second)
|
||||
term.client.Halt()
|
||||
}()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user