From d91da8feee111fb0ace4db8f83822b41a04f73ea Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Sat, 25 May 2019 19:51:13 +0200 Subject: [PATCH] lib/model: Readd special handling of conn close in TestIssue5063 (#5743) This partially reverts commit 64518b0f7e74ad5f6d42f9a3b6ffc1f74b61c2f0. --- lib/model/model_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/model/model_test.go b/lib/model/model_test.go index 2ba864be6..7bdff3aa6 100644 --- a/lib/model/model_test.go +++ b/lib/model/model_test.go @@ -862,6 +862,16 @@ func TestIssue5063(t *testing.T) { m := newState(defaultAutoAcceptCfg) defer cleanupModel(m) + m.pmut.Lock() + for _, c := range m.conn { + conn := c.(*fakeConnection) + conn.mut.Lock() + conn.closeFn = func(_ error) {} + conn.mut.Unlock() + defer m.Closed(c, errStopped) // to unblock deferred m.Stop() + } + m.pmut.Unlock() + wg := sync.WaitGroup{} addAndVerify := func(id string) {