Fix mock querynode server session not revoked (#17229)

Revoke mock querynode server session when it's stopped
This PR reduces the running time of TestLoadBalanceIndexedSegmentsAfterNodeDown from 60+ seconds to less than 1+ seconds
Also related to #17212 #17215

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/17634/head
congqixia 2022-06-18 18:22:12 +08:00 committed by GitHub
parent 144f7a2d80
commit 50cecc65ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -22,6 +22,7 @@ import (
"net"
"strconv"
"sync"
"time"
"go.uber.org/zap"
"google.golang.org/grpc"
@ -172,6 +173,9 @@ func (qs *queryNodeServerMock) start() error {
func (qs *queryNodeServerMock) stop() error {
qs.cancel()
if qs.session != nil {
qs.session.Revoke(time.Second)
}
if qs.grpcServer != nil {
qs.grpcServer.GracefulStop()
}