diff --git a/router/router.go b/router/router.go index 123bdf199..f0da6a74c 100644 --- a/router/router.go +++ b/router/router.go @@ -90,6 +90,12 @@ func (self *Router) MetricsRegistry() metrics.UsageRegistry { } func (self *Router) Channel() channel2.Channel { + // if we're just starting up, we may be nil. wait till initialized + // The initial control channel connect has a timeout, so if that timeouts the process will exit + // Once connected the control channel will never get set back to nil. Reconnects happen under the hood + for self.ctrl == nil { + time.Sleep(50 * time.Millisecond) + } return self.ctrl } diff --git a/router/xgress/ordering_test.go b/router/xgress/ordering_test.go index 6c7f77fcf..f76919fd9 100644 --- a/router/xgress/ordering_test.go +++ b/router/xgress/ordering_test.go @@ -106,7 +106,7 @@ func Test_Ordering(t *testing.T) { } }() - timeout := time.After(10 * time.Second) + timeout := time.After(20 * time.Second) req := require.New(t) for i := 0; i < msgCount; i++ { diff --git a/tests/link_test.go b/tests/link_test.go index b91607dee..89c77a1b9 100644 --- a/tests/link_test.go +++ b/tests/link_test.go @@ -1,3 +1,5 @@ +//go:build apitests + package tests import (