maraino / go-mock

A mocking framework for the Go Programming Language.
MIT License
35 stars 12 forks source link

Fix .Timeout() with mutexes (broken with #10) #11

Closed wadey closed 7 years ago

wadey commented 7 years ago

in #10 we added a mutex around .Called(), but this causes an issue when the mock has .Timeout() set. Currently all callers to the mock are locked out for this timeout.

As a simple fix, wait to do the sleep until after we have finished the method and unlocked the mutex.

maraino commented 7 years ago

Makes sense. Merging it.