diff --git a/http/http_test.go b/http/http_test.go index 8fe5eb7..93ad1fb 100644 --- a/http/http_test.go +++ b/http/http_test.go @@ -13,6 +13,7 @@ import ( "github.com/chihaya/bencode" "github.com/chihaya/chihaya/config" + "github.com/chihaya/chihaya/stats" "github.com/chihaya/chihaya/tracker" _ "github.com/chihaya/chihaya/backend/noop" @@ -23,6 +24,10 @@ type params map[string]string var infoHash = string([]byte{0x89, 0xd4, 0xbc, 0x52, 0x11, 0x16, 0xca, 0x1d, 0x42, 0xa2, 0xf3, 0x0d, 0x1f, 0x27, 0x4d, 0x94, 0xe4, 0x68, 0x1d, 0xaf}) +func init() { + stats.DefaultStats = stats.New(config.StatsConfig{}) +} + func setupTracker(cfg *config.Config) (*httptest.Server, error) { tkr, err := tracker.New(cfg) if err != nil {