summaryrefslogtreecommitdiff
path: root/tests/mocks
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-01-25 13:10:06 +0300
committerValery Piashchynski <[email protected]>2021-01-25 13:10:06 +0300
commit2a0e7d37d825da6bb0538599ce0e2edaaa59403b (patch)
tree89c00a43333246bb6c6815c923548eecd7d4e717 /tests/mocks
parentb18a3578b6d299aac5dfcc016c2a3a0f6905aa0d (diff)
resolve #415
Diffstat (limited to 'tests/mocks')
-rw-r--r--tests/mocks/mock_log.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/mocks/mock_log.go b/tests/mocks/mock_log.go
index e9631805..66c70b91 100644
--- a/tests/mocks/mock_log.go
+++ b/tests/mocks/mock_log.go
@@ -2,6 +2,7 @@ package mocks
import (
"reflect"
+ "sync"
"github.com/golang/mock/gomock"
"github.com/spiral/roadrunner/v2/plugins/logger"
@@ -9,6 +10,7 @@ import (
// MockLogger is a mock of Logger interface.
type MockLogger struct {
+ sync.Mutex
ctrl *gomock.Controller
recorder *MockLoggerMockRecorder
}
@@ -38,6 +40,8 @@ func (m *MockLogger) Init() error {
// Debug mocks base method.
func (m *MockLogger) Debug(msg string, keyvals ...interface{}) {
+ m.Lock()
+ defer m.Unlock()
m.ctrl.T.Helper()
varargs := []interface{}{msg}
for _, a := range keyvals {
@@ -48,6 +52,8 @@ func (m *MockLogger) Debug(msg string, keyvals ...interface{}) {
// Warn mocks base method.
func (m *MockLogger) Warn(msg string, keyvals ...interface{}) {
+ m.Lock()
+ defer m.Unlock()
m.ctrl.T.Helper()
varargs := []interface{}{msg}
for _, a := range keyvals {
@@ -58,6 +64,8 @@ func (m *MockLogger) Warn(msg string, keyvals ...interface{}) {
// Info mocks base method.
func (m *MockLogger) Info(msg string, keyvals ...interface{}) {
+ m.Lock()
+ defer m.Unlock()
m.ctrl.T.Helper()
varargs := []interface{}{msg}
for _, a := range keyvals {
@@ -68,6 +76,8 @@ func (m *MockLogger) Info(msg string, keyvals ...interface{}) {
// Error mocks base method.
func (m *MockLogger) Error(msg string, keyvals ...interface{}) {
+ m.Lock()
+ defer m.Unlock()
m.ctrl.T.Helper()
varargs := []interface{}{msg}
for _, a := range keyvals {