Silence broker during tests

This commit is contained in:
Asim Aslam 2019-01-16 18:54:04 +00:00
parent 082f57fcad
commit 5b95ce7f26

View File

@ -5,7 +5,9 @@ import (
"testing" "testing"
"time" "time"
glog "github.com/go-log/log"
"github.com/google/uuid" "github.com/google/uuid"
"github.com/micro/go-log"
"github.com/micro/go-micro/registry/memory" "github.com/micro/go-micro/registry/memory"
) )
@ -17,6 +19,9 @@ func newTestRegistry() *memory.Registry {
} }
func sub(be *testing.B, c int) { func sub(be *testing.B, c int) {
// set no op logger
log.SetLogger(glog.DefaultLogger)
be.StopTimer() be.StopTimer()
m := newTestRegistry() m := newTestRegistry()
@ -77,6 +82,9 @@ func sub(be *testing.B, c int) {
} }
func pub(be *testing.B, c int) { func pub(be *testing.B, c int) {
// set no op logger
log.SetLogger(glog.DefaultLogger)
be.StopTimer() be.StopTimer()
m := newTestRegistry() m := newTestRegistry()
b := NewBroker(Registry(m)) b := NewBroker(Registry(m))