Silence broker during tests
This commit is contained in:
		| @@ -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)) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user