fix: etcd discovery mechanism on grpc with idle manager (#4589)

This commit is contained in:
Kevin Wan
2025-01-22 14:01:18 +08:00
committed by GitHub
parent 33011c7ed1
commit bf883101d7
9 changed files with 494 additions and 285 deletions

View File

@@ -1,7 +1,6 @@
package internal
import (
"github.com/zeromicro/go-zero/core/discov"
"testing"
"github.com/stretchr/testify/assert"
@@ -19,20 +18,6 @@ func TestNopResolver(t *testing.T) {
})
}
func TestNopResolver_Close(t *testing.T) {
var isChanged bool
r := nopResolver{}
r.Close()
assert.False(t, isChanged)
r = nopResolver{
closeFunc: func() {
isChanged = true
},
}
r.Close()
assert.True(t, isChanged)
}
type mockedClientConn struct {
state resolver.State
err error