mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 23:02:16 +00:00
Make pool tests faster
This commit is contained in:
parent
87e1f76324
commit
a4606f1c5e
@ -12,7 +12,6 @@ import (
|
|||||||
const (
|
const (
|
||||||
maxOutstandingRequestsPerPeer = 10
|
maxOutstandingRequestsPerPeer = 10
|
||||||
eventsChannelCapacity = 100
|
eventsChannelCapacity = 100
|
||||||
requestTimeoutSeconds = 10
|
|
||||||
maxTries = 3
|
maxTries = 3
|
||||||
requestIntervalMS = 500
|
requestIntervalMS = 500
|
||||||
requestBatchSize = 50
|
requestBatchSize = 50
|
||||||
@ -21,6 +20,10 @@ const (
|
|||||||
maxPeersPerRequest = 1
|
maxPeersPerRequest = 1
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
requestTimeoutSeconds = time.Duration(10)
|
||||||
|
)
|
||||||
|
|
||||||
type BlockRequest struct {
|
type BlockRequest struct {
|
||||||
Height uint
|
Height uint
|
||||||
PeerId string
|
PeerId string
|
||||||
|
@ -3,6 +3,7 @@ package blockchain
|
|||||||
import (
|
import (
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
. "github.com/tendermint/tendermint/common"
|
. "github.com/tendermint/tendermint/common"
|
||||||
"github.com/tendermint/tendermint/types"
|
"github.com/tendermint/tendermint/types"
|
||||||
@ -74,6 +75,10 @@ func TestBasic(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestTimeout(t *testing.T) {
|
func TestTimeout(t *testing.T) {
|
||||||
|
origRequestTimeoutSeconds := requestTimeoutSeconds
|
||||||
|
requestTimeoutSeconds = time.Duration(0)
|
||||||
|
defer func() { requestTimeoutSeconds = origRequestTimeoutSeconds }()
|
||||||
|
|
||||||
peers := makePeers(100, 0, 1000)
|
peers := makePeers(100, 0, 1000)
|
||||||
start := uint(42)
|
start := uint(42)
|
||||||
timeoutsCh := make(chan string, 10)
|
timeoutsCh := make(chan string, 10)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user