pkg/proc,pkg/terminal: close response body in tests (#3372)

This commit is contained in:
Oleksandr Redko 2023-05-17 13:01:26 +03:00 committed by GitHub
parent 84b757ad57
commit c5d9baaeb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

@ -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()
}()