mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 14:46:42 +00:00
node: avoid double close resp.Body
This commit is contained in:
parent
b62756d1a3
commit
0e834571ad
1 changed files with 0 additions and 2 deletions
|
|
@ -570,7 +570,6 @@ func TestHTTPWriteTimeout(t *testing.T) {
|
||||||
// Send normal request
|
// Send normal request
|
||||||
t.Run("message", func(t *testing.T) {
|
t.Run("message", func(t *testing.T) {
|
||||||
resp := rpcRequest(t, url, "test_sleep")
|
resp := rpcRequest(t, url, "test_sleep")
|
||||||
defer resp.Body.Close()
|
|
||||||
body, err := io.ReadAll(resp.Body)
|
body, err := io.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
|
@ -584,7 +583,6 @@ func TestHTTPWriteTimeout(t *testing.T) {
|
||||||
t.Run("batch", func(t *testing.T) {
|
t.Run("batch", func(t *testing.T) {
|
||||||
want := fmt.Sprintf("[%s,%s,%s]", greetRes, timeoutRes, timeoutRes)
|
want := fmt.Sprintf("[%s,%s,%s]", greetRes, timeoutRes, timeoutRes)
|
||||||
resp := batchRpcRequest(t, url, []string{"test_greet", "test_sleep", "test_greet"})
|
resp := batchRpcRequest(t, url, []string{"test_greet", "test_sleep", "test_greet"})
|
||||||
defer resp.Body.Close()
|
|
||||||
body, err := io.ReadAll(resp.Body)
|
body, err := io.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue