mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-14 18:30:02 +08:00
fix: routinegroup & etcd watch goroutine leak (#4514)
Co-authored-by: Kevin Wan <wanjunfeng@gmail.com>
This commit is contained in:
@@ -214,6 +214,18 @@ func TestSubscriber(t *testing.T) {
|
||||
assert.Equal(t, int32(1), atomic.LoadInt32(&count))
|
||||
}
|
||||
|
||||
func TestSubscriberClos(t *testing.T) {
|
||||
l := newContainer(false)
|
||||
sub := &Subscriber{
|
||||
endpoints: []string{"localhost:2379"},
|
||||
key: "foo",
|
||||
items: l,
|
||||
}
|
||||
_ = internal.GetRegistry().Monitor(sub.endpoints, sub.key, l, false)
|
||||
sub.Close()
|
||||
assert.Empty(t, sub.items.listeners)
|
||||
}
|
||||
|
||||
func TestWithSubEtcdAccount(t *testing.T) {
|
||||
endpoints := []string{"localhost:2379"}
|
||||
user := stringx.Rand()
|
||||
|
||||
Reference in New Issue
Block a user