Skip to content

Commit 08f4128

Browse files
author
Qi Xiao
committed
Fix unittest rpc session leak
1 parent e0f594f commit 08f4128

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

rpc/mux/wrapper_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ func TestCaller_CallNode(t *testing.T) {
5858
log.Debugf("GConf: %#v", conf.GConf)
5959
// reset the once
6060
route.Once.Reset()
61+
_ = GetSessionPoolInstance().Close()
6162
route.InitKMS(publicKeyStore)
6263

6364
addr := conf.GConf.ListenAddr // see ../test/node_standalone/config.yaml
@@ -189,6 +190,7 @@ func TestNewPersistentCaller(t *testing.T) {
189190
log.Debugf("GConf: %#v", conf.GConf)
190191
// reset the once
191192
route.Once.Reset()
193+
_ = GetSessionPoolInstance().Close()
192194
route.InitKMS(publicKeyStore)
193195

194196
addr := conf.GConf.ListenAddr // see ../test/node_standalone/config.yaml
@@ -335,6 +337,7 @@ func BenchmarkPersistentCaller_CallKayakLog(b *testing.B) {
335337
log.Debugf("GConf: %#v", conf.GConf)
336338
// reset the once
337339
route.Once.Reset()
340+
_ = GetSessionPoolInstance().Close()
338341
route.InitKMS(publicKeyStore)
339342

340343
addr := conf.GConf.ListenAddr
@@ -411,6 +414,7 @@ func BenchmarkPersistentCaller_Call(b *testing.B) {
411414
log.Debugf("GConf: %#v", conf.GConf)
412415
// reset the once
413416
route.Once.Reset()
417+
_ = GetSessionPoolInstance().Close()
414418
route.InitKMS(publicKeyStore)
415419

416420
addr := conf.GConf.ListenAddr // see ../test/node_standalone/config.yaml

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy