Unverified Commit 496f05cf authored by s7v7nislands's avatar s7v7nislands Committed by GitHub

rpc: fix defer in test (#24490)

Co-authored-by: 's avatarFelix Lange <fjl@twurst.com>
parent 8f66ea37
......@@ -134,7 +134,7 @@ func TestServerShortLivedConn(t *testing.T) {
if err != nil {
t.Fatal("can't dial:", err)
}
defer conn.Close()
conn.SetDeadline(deadline)
// Write the request, then half-close the connection so the server stops reading.
conn.Write([]byte(request))
......@@ -142,6 +142,8 @@ func TestServerShortLivedConn(t *testing.T) {
// Now try to get the response.
buf := make([]byte, 2000)
n, err := conn.Read(buf)
conn.Close()
if err != nil {
t.Fatal("read error:", err)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment