mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #13558 from gfuzz-asplos/main
fixing goroutine leaks
This commit is contained in:
commit
0285f74aea
@ -33,7 +33,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func dummyIndexWaiter(index uint64) <-chan struct{} {
|
func dummyIndexWaiter(index uint64) <-chan struct{} {
|
||||||
ch := make(chan struct{})
|
ch := make(chan struct{}, 1)
|
||||||
go func() {
|
go func() {
|
||||||
ch <- struct{}{}
|
ch <- struct{}{}
|
||||||
}()
|
}()
|
||||||
|
@ -724,6 +724,8 @@ func TestConcurrentReadTxAndWrite(t *testing.T) {
|
|||||||
)
|
)
|
||||||
b, tmpPath := betesting.NewDefaultTmpBackend(t)
|
b, tmpPath := betesting.NewDefaultTmpBackend(t)
|
||||||
s := NewStore(zap.NewExample(), b, &lease.FakeLessor{}, StoreConfig{})
|
s := NewStore(zap.NewExample(), b, &lease.FakeLessor{}, StoreConfig{})
|
||||||
|
defer b.Close()
|
||||||
|
defer s.Close()
|
||||||
defer os.Remove(tmpPath)
|
defer os.Remove(tmpPath)
|
||||||
|
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
|
@ -265,7 +265,8 @@ func TestWatchFutureRev(t *testing.T) {
|
|||||||
s := newWatchableStore(zap.NewExample(), b, &lease.FakeLessor{}, StoreConfig{})
|
s := newWatchableStore(zap.NewExample(), b, &lease.FakeLessor{}, StoreConfig{})
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
s.store.Close()
|
b.Close()
|
||||||
|
s.Close()
|
||||||
os.Remove(tmpPath)
|
os.Remove(tmpPath)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -216,7 +216,8 @@ func TestWatchDeleteRange(t *testing.T) {
|
|||||||
s := newWatchableStore(zap.NewExample(), b, &lease.FakeLessor{}, StoreConfig{})
|
s := newWatchableStore(zap.NewExample(), b, &lease.FakeLessor{}, StoreConfig{})
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
s.store.Close()
|
b.Close()
|
||||||
|
s.Close()
|
||||||
os.Remove(tmpPath)
|
os.Remove(tmpPath)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user