From e62fdb449d46ef543a38efef399b95a743807c2f Mon Sep 17 00:00:00 2001 From: tycho garen Date: Fri, 18 Mar 2022 11:36:29 -0400 Subject: [PATCH] mempool: reduce size of test --- internal/mempool/reactor_test.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/internal/mempool/reactor_test.go b/internal/mempool/reactor_test.go index dab63af73..833f44525 100644 --- a/internal/mempool/reactor_test.go +++ b/internal/mempool/reactor_test.go @@ -130,6 +130,7 @@ func (rts *reactorTestSuite) waitForTxns(t *testing.T, txs []types.Tx, ids ...ty // ensure that the transactions get fully broadcast to the // rest of the network wg := &sync.WaitGroup{} + var count int for name, pool := range rts.mempools { if !p2ptest.NodeInSlice(name, ids) { continue @@ -139,14 +140,15 @@ func (rts *reactorTestSuite) waitForTxns(t *testing.T, txs []types.Tx, ids ...ty } wg.Add(1) - go func(pool *TxMempool) { + go func(name types.NodeID, pool *TxMempool) { defer wg.Done() require.Eventually(t, func() bool { return len(txs) == pool.Size() }, time.Minute, 250*time.Millisecond, - "ntx=%d, size=%d", len(txs), pool.Size(), + "node=%q, ntx=%d, size=%d", name, len(txs), pool.Size(), ) - }(pool) + }(name, pool) + count++ } wg.Wait() } @@ -196,8 +198,8 @@ func TestReactorBroadcastDoesNotPanic(t *testing.T) { } func TestReactorBroadcastTxs(t *testing.T) { - numTxs := 1000 - numNodes := 10 + numTxs := 512 + numNodes := 4 ctx, cancel := context.WithCancel(context.Background()) defer cancel()