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{} {
|
||||
ch := make(chan struct{})
|
||||
ch := make(chan struct{}, 1)
|
||||
go func() {
|
||||
ch <- struct{}{}
|
||||
}()
|
||||
|
@ -724,6 +724,8 @@ func TestConcurrentReadTxAndWrite(t *testing.T) {
|
||||
)
|
||||
b, tmpPath := betesting.NewDefaultTmpBackend(t)
|
||||
s := NewStore(zap.NewExample(), b, &lease.FakeLessor{}, StoreConfig{})
|
||||
defer b.Close()
|
||||
defer s.Close()
|
||||
defer os.Remove(tmpPath)
|
||||
|
||||
var wg sync.WaitGroup
|
||||
|
@ -265,7 +265,8 @@ func TestWatchFutureRev(t *testing.T) {
|
||||
s := newWatchableStore(zap.NewExample(), b, &lease.FakeLessor{}, StoreConfig{})
|
||||
|
||||
defer func() {
|
||||
s.store.Close()
|
||||
b.Close()
|
||||
s.Close()
|
||||
os.Remove(tmpPath)
|
||||
}()
|
||||
|
||||
|
@ -216,7 +216,8 @@ func TestWatchDeleteRange(t *testing.T) {
|
||||
s := newWatchableStore(zap.NewExample(), b, &lease.FakeLessor{}, StoreConfig{})
|
||||
|
||||
defer func() {
|
||||
s.store.Close()
|
||||
b.Close()
|
||||
s.Close()
|
||||
os.Remove(tmpPath)
|
||||
}()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user