rpc: close Clients in tests (#29512)
This commit is contained in:
parent
e4ecaf89cf
commit
71c78bf56d
@ -253,6 +253,7 @@ func TestClientBatchRequestLimit(t *testing.T) {
|
|||||||
defer server.Stop()
|
defer server.Stop()
|
||||||
server.SetBatchLimits(2, 100000)
|
server.SetBatchLimits(2, 100000)
|
||||||
client := DialInProc(server)
|
client := DialInProc(server)
|
||||||
|
defer client.Close()
|
||||||
|
|
||||||
batch := []BatchElem{
|
batch := []BatchElem{
|
||||||
{Method: "foo"},
|
{Method: "foo"},
|
||||||
@ -342,6 +343,7 @@ func testClientCancel(transport string, t *testing.T) {
|
|||||||
default:
|
default:
|
||||||
panic("unknown transport: " + transport)
|
panic("unknown transport: " + transport)
|
||||||
}
|
}
|
||||||
|
defer client.Close()
|
||||||
|
|
||||||
// The actual test starts here.
|
// The actual test starts here.
|
||||||
var (
|
var (
|
||||||
@ -592,6 +594,7 @@ func TestClientSubscriptionChannelClose(t *testing.T) {
|
|||||||
|
|
||||||
srv.RegisterName("nftest", new(notificationTestService))
|
srv.RegisterName("nftest", new(notificationTestService))
|
||||||
client, _ := Dial(wsURL)
|
client, _ := Dial(wsURL)
|
||||||
|
defer client.Close()
|
||||||
|
|
||||||
for i := 0; i < 100; i++ {
|
for i := 0; i < 100; i++ {
|
||||||
ch := make(chan int, 100)
|
ch := make(chan int, 100)
|
||||||
@ -708,7 +711,6 @@ func TestClientHTTP(t *testing.T) {
|
|||||||
errc = make(chan error, len(results))
|
errc = make(chan error, len(results))
|
||||||
wantResult = echoResult{"a", 1, new(echoArgs)}
|
wantResult = echoResult{"a", 1, new(echoArgs)}
|
||||||
)
|
)
|
||||||
defer client.Close()
|
|
||||||
for i := range results {
|
for i := range results {
|
||||||
i := i
|
i := i
|
||||||
go func() {
|
go func() {
|
||||||
|
@ -187,6 +187,7 @@ func TestWebsocketPeerInfo(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
defer c.Close()
|
||||||
|
|
||||||
// Request peer information.
|
// Request peer information.
|
||||||
var connInfo PeerInfo
|
var connInfo PeerInfo
|
||||||
@ -273,6 +274,7 @@ func TestClientWebsocketLargeMessage(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
defer c.Close()
|
||||||
|
|
||||||
var r string
|
var r string
|
||||||
if err := c.Call(&r, "test_largeResp"); err != nil {
|
if err := c.Call(&r, "test_largeResp"); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user