Browse Source

mempool: reactor concurrency test tweaks (#7651)

pull/7669/head
Sam Kleinman 3 years ago
committed by GitHub
parent
commit
8280672d33
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 5 deletions
  1. +3
    -5
      internal/mempool/reactor_test.go

+ 3
- 5
internal/mempool/reactor_test.go View File

@ -3,6 +3,7 @@ package mempool
import ( import (
"context" "context"
"os" "os"
"runtime"
"strings" "strings"
"sync" "sync"
"testing" "testing"
@ -214,7 +215,7 @@ func TestReactorBroadcastTxs(t *testing.T) {
// regression test for https://github.com/tendermint/tendermint/issues/5408 // regression test for https://github.com/tendermint/tendermint/issues/5408
func TestReactorConcurrency(t *testing.T) { func TestReactorConcurrency(t *testing.T) {
numTxs := 5
numTxs := 10
numNodes := 2 numNodes := 2
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
@ -229,7 +230,7 @@ func TestReactorConcurrency(t *testing.T) {
var wg sync.WaitGroup var wg sync.WaitGroup
for i := 0; i < 1000; i++ {
for i := 0; i < runtime.NumCPU()*2; i++ {
wg.Add(2) wg.Add(2)
// 1. submit a bunch of txs // 1. submit a bunch of txs
@ -266,9 +267,6 @@ func TestReactorConcurrency(t *testing.T) {
err := mempool.Update(ctx, 1, []types.Tx{}, make([]*abci.ResponseDeliverTx, 0), nil, nil) err := mempool.Update(ctx, 1, []types.Tx{}, make([]*abci.ResponseDeliverTx, 0), nil, nil)
require.NoError(t, err) require.NoError(t, err)
}() }()
// flush the mempool
rts.mempools[secondary].Flush()
} }
wg.Wait() wg.Wait()


Loading…
Cancel
Save