From cf67a8b1b752435ce4a6bf0db582419c42df4cd7 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Sun, 3 Feb 2019 17:16:26 +0400 Subject: [PATCH] no timeout --- libs/pubsub/pubsub.go | 3 +-- types/event_bus_test.go | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/pubsub/pubsub.go b/libs/pubsub/pubsub.go index b1b648236..9ad634306 100644 --- a/libs/pubsub/pubsub.go +++ b/libs/pubsub/pubsub.go @@ -38,7 +38,6 @@ import ( "context" "errors" "sync" - "time" cmn "github.com/tendermint/tendermint/libs/common" ) @@ -395,7 +394,7 @@ func (state *state) send(msg interface{}, tags map[string]string) { // don't block on buffered channels select { case subscription.out <- Message{msg, tags}: - case <-time.After(100 * time.Millisecond): + default: state.remove(clientID, qStr, ErrOutOfCapacity) } } diff --git a/types/event_bus_test.go b/types/event_bus_test.go index be3f2315f..508b423a6 100644 --- a/types/event_bus_test.go +++ b/types/event_bus_test.go @@ -139,10 +139,11 @@ func TestEventBusPublish(t *testing.T) { require.NoError(t, err) defer eventBus.Stop() - sub, err := eventBus.Subscribe(context.Background(), "test", tmquery.Empty{}) + const numEventsExpected = 14 + + sub, err := eventBus.Subscribe(context.Background(), "test", tmquery.Empty{}, numEventsExpected) require.NoError(t, err) - const numEventsExpected = 14 done := make(chan struct{}) go func() { numEvents := 0