lib/model: Readd special handling of conn close in TestIssue5063 (#5743)

This partially reverts commit 64518b0f7e.
This commit is contained in:
Simon Frei 2019-05-25 19:51:13 +02:00 committed by Audrius Butkevicius
parent 64518b0f7e
commit d91da8feee

View File

@ -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) {