From ac0788cb5a43dcf78c75781a262a6e813d61c891 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Sat, 4 Apr 2015 19:50:19 +0100 Subject: [PATCH] simplify test router creation --- router/gossip_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/router/gossip_test.go b/router/gossip_test.go index 907b2e4e..66622193 100644 --- a/router/gossip_test.go +++ b/router/gossip_test.go @@ -14,14 +14,14 @@ type mockChannelConnection struct { dest *Router } -// Construct a "passive" Router, i.e. without any goroutines. -// -// We need to create some dummy channels otherwise tests hang on nil -// channels when Router.OnGossip() calls async methods. +// Construct a "passive" Router, i.e. without any goroutines, except +// for Routes and GossipSenders. func NewTestRouter(name PeerName) *Router { router := NewRouter(nil, name, "", nil, 10, 1024, nil) + // need to create a dummy channel otherwise tests hang on nil + // channels when the Router invoked ConnectionMaker.Refresh router.ConnectionMaker.actionChan = make(chan ConnectionMakerAction, ChannelSize) - router.Routes.recalculate = make(chan *struct{}, 1) + router.Routes.Start() return router }