Skip to content

Commit

Permalink
fix(tests): fix deadlock for non-race tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mefellows committed Jul 14, 2018
1 parent 56c79b2 commit 256c2c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ func TestServiceManager_removeServiceMonitor(t *testing.T) {
mgr.commandCompleteChan <- cmd
var timeout = time.After(channelTimeout)
for {
mgr.processMap.Lock()
defer mgr.processMap.Unlock()

select {
case <-time.After(10 * time.Millisecond):
mgr.processMap.Lock()
if len(mgr.processMap.processes) == 0 {
mgr.processMap.Unlock()
return
}
case <-timeout:
Expand Down

0 comments on commit 256c2c8

Please sign in to comment.