Skip to content

Commit da8143f

Browse files
itest: close context after closing conn for client
1 parent b461313 commit da8143f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

itest/client_harness.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ func (c *clientHarness) start() error {
119119
}
120120

121121
func (c *clientHarness) cleanup() error {
122-
c.cancel()
122+
// We cancel the context after closing the connection, as it's used
123+
// during the connection closing process. We defer the cancel to make
124+
// sure it's always canceled.
125+
defer c.cancel()
126+
123127
return c.grpcConn.Close()
124128
}

0 commit comments

Comments
 (0)