From 221dbe5ed46703ee255b1da0dec05086f5035f62 Mon Sep 17 00:00:00 2001 From: xiaolei Date: Fri, 17 May 2019 13:51:56 -0400 Subject: [PATCH] fix mutex --- mock/mock.go | 1 + 1 file changed, 1 insertion(+) diff --git a/mock/mock.go b/mock/mock.go index 1171c0024..b5288af5b 100644 --- a/mock/mock.go +++ b/mock/mock.go @@ -350,6 +350,7 @@ func (m *Mock) MethodCalled(methodName string, arguments ...interface{}) Argumen if found < 0 { // expected call found but it has already been called with repeatable times if call != nil { + m.mutex.Unlock() m.fail("\nassert: mock: The method has been called over %d times.\n\tEither do one more Mock.On(\"%s\").Return(...), or remove extra call.\n\tThis call was unexpected:\n\t\t%s\n\tat: %s", call.totalCalls, methodName, callString(methodName, arguments, true), assert.CallerInfo()) } // we have to fail here - because we don't know what to do