diff --git a/api/subscriptions/subscriptions_test.go b/api/subscriptions/subscriptions_test.go index a128b72c6..bbf454657 100644 --- a/api/subscriptions/subscriptions_test.go +++ b/api/subscriptions/subscriptions_test.go @@ -17,6 +17,7 @@ import ( "github.com/gorilla/mux" "github.com/gorilla/websocket" + "github.com/inconshreveable/log15" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/vechain/thor/v2/block" @@ -33,6 +34,7 @@ var repo *chain.Repository var blocks []*block.Block func TestSubscriptions(t *testing.T) { + log.SetHandler(log15.LvlFilterHandler(log15.LvlDebug, log15.StdoutHandler)) initSubscriptionsServer(t) defer ts.Close() @@ -75,19 +77,19 @@ func testHandlePendingTransactions(t *testing.T) { transaction := createTx(t, repo, 1) assert.NoError(t, txPool.AddLocal(transaction)) - var wsNotif bool + var mempoolNotif, wsNotif bool var msg []byte for { select { - //case <-txChan: - // mempoolNotif = true + case <-txChan: + mempoolNotif = true case rcvMsg := <-wsChan: msg = rcvMsg wsNotif = true case <-time.After(5 * time.Second): t.Fatal("message not received in time") } - if wsNotif { + if wsNotif && mempoolNotif { break } }