forked from cerc-io/plugeth
les/vflux: run tests in parallel (#28524)
This commit is contained in:
parent
3cfcd252db
commit
5ff929c22f
@ -65,6 +65,8 @@ func (i *testIter) waiting(timeout time.Duration) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestFillSet(t *testing.T) {
|
func TestFillSet(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
ns := nodestate.NewNodeStateMachine(nil, nil, &mclock.Simulated{}, testSetup)
|
ns := nodestate.NewNodeStateMachine(nil, nil, &mclock.Simulated{}, testSetup)
|
||||||
iter := &testIter{
|
iter := &testIter{
|
||||||
waitCh: make(chan struct{}),
|
waitCh: make(chan struct{}),
|
||||||
|
@ -31,10 +31,14 @@ func testNode(i int) *enode.Node {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestQueueIteratorFIFO(t *testing.T) {
|
func TestQueueIteratorFIFO(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
testQueueIterator(t, true)
|
testQueueIterator(t, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestQueueIteratorLIFO(t *testing.T) {
|
func TestQueueIteratorLIFO(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
testQueueIterator(t, false)
|
testQueueIterator(t, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,6 +36,8 @@ func checkF64(t *testing.T, name string, value, exp, tol float64) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestServerBasket(t *testing.T) {
|
func TestServerBasket(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
var s serverBasket
|
var s serverBasket
|
||||||
s.init(2)
|
s.init(2)
|
||||||
// add some requests with different request value factors
|
// add some requests with different request value factors
|
||||||
@ -70,6 +72,8 @@ func TestServerBasket(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestConvertMapping(t *testing.T) {
|
func TestConvertMapping(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
b := requestBasket{items: []basketItem{{3, 3}, {1, 1}, {2, 2}}}
|
b := requestBasket{items: []basketItem{{3, 3}, {1, 1}, {2, 2}}}
|
||||||
oldMap := []string{"req3", "req1", "req2"}
|
oldMap := []string{"req3", "req1", "req2"}
|
||||||
newMap := []string{"req1", "req2", "req3", "req4"}
|
newMap := []string{"req1", "req2", "req3", "req4"}
|
||||||
@ -82,6 +86,8 @@ func TestConvertMapping(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestReqValueFactor(t *testing.T) {
|
func TestReqValueFactor(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
var ref referenceBasket
|
var ref referenceBasket
|
||||||
ref.basket = requestBasket{items: make([]basketItem, 4)}
|
ref.basket = requestBasket{items: make([]basketItem, 4)}
|
||||||
for i := range ref.basket.items {
|
for i := range ref.basket.items {
|
||||||
@ -95,6 +101,8 @@ func TestReqValueFactor(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestNormalize(t *testing.T) {
|
func TestNormalize(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
for cycle := 0; cycle < 100; cycle += 1 {
|
for cycle := 0; cycle < 100; cycle += 1 {
|
||||||
// Initialize data for testing
|
// Initialize data for testing
|
||||||
valueRange, lower := 1000000, 1000000
|
valueRange, lower := 1000000, 1000000
|
||||||
@ -119,6 +127,8 @@ func TestNormalize(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestReqValueAdjustment(t *testing.T) {
|
func TestReqValueAdjustment(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
var s1, s2 serverBasket
|
var s1, s2 serverBasket
|
||||||
s1.init(3)
|
s1.init(3)
|
||||||
s2.init(3)
|
s2.init(3)
|
||||||
|
@ -326,9 +326,21 @@ func (s *ServerPoolTest) checkNodes(t *testing.T, nodes []int) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestServerPool(t *testing.T) { testServerPool(t, false, false) }
|
func TestServerPool(t *testing.T) {
|
||||||
func TestServerPoolWithPreNeg(t *testing.T) { testServerPool(t, true, false) }
|
t.Parallel()
|
||||||
func TestServerPoolWithPreNegFail(t *testing.T) { testServerPool(t, true, true) }
|
|
||||||
|
testServerPool(t, false, false)
|
||||||
|
}
|
||||||
|
func TestServerPoolWithPreNeg(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
|
testServerPool(t, true, false)
|
||||||
|
}
|
||||||
|
func TestServerPoolWithPreNegFail(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
|
testServerPool(t, true, true)
|
||||||
|
}
|
||||||
func testServerPool(t *testing.T, preNeg, fail bool) {
|
func testServerPool(t *testing.T, preNeg, fail bool) {
|
||||||
s := newServerPoolTest(preNeg, fail)
|
s := newServerPoolTest(preNeg, fail)
|
||||||
nodes := s.setNodes(100, 200, 200, true, false)
|
nodes := s.setNodes(100, 200, 200, true, false)
|
||||||
@ -339,8 +351,16 @@ func testServerPool(t *testing.T, preNeg, fail bool) {
|
|||||||
s.checkNodes(t, nodes)
|
s.checkNodes(t, nodes)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestServerPoolChangedNodes(t *testing.T) { testServerPoolChangedNodes(t, false) }
|
func TestServerPoolChangedNodes(t *testing.T) {
|
||||||
func TestServerPoolChangedNodesWithPreNeg(t *testing.T) { testServerPoolChangedNodes(t, true) }
|
t.Parallel()
|
||||||
|
|
||||||
|
testServerPoolChangedNodes(t, false)
|
||||||
|
}
|
||||||
|
func TestServerPoolChangedNodesWithPreNeg(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
|
testServerPoolChangedNodes(t, true)
|
||||||
|
}
|
||||||
func testServerPoolChangedNodes(t *testing.T, preNeg bool) {
|
func testServerPoolChangedNodes(t *testing.T, preNeg bool) {
|
||||||
s := newServerPoolTest(preNeg, false)
|
s := newServerPoolTest(preNeg, false)
|
||||||
nodes := s.setNodes(100, 200, 200, true, false)
|
nodes := s.setNodes(100, 200, 200, true, false)
|
||||||
@ -358,8 +378,14 @@ func testServerPoolChangedNodes(t *testing.T, preNeg bool) {
|
|||||||
s.stop()
|
s.stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestServerPoolRestartNoDiscovery(t *testing.T) { testServerPoolRestartNoDiscovery(t, false) }
|
func TestServerPoolRestartNoDiscovery(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
|
testServerPoolRestartNoDiscovery(t, false)
|
||||||
|
}
|
||||||
func TestServerPoolRestartNoDiscoveryWithPreNeg(t *testing.T) {
|
func TestServerPoolRestartNoDiscoveryWithPreNeg(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
testServerPoolRestartNoDiscovery(t, true)
|
testServerPoolRestartNoDiscovery(t, true)
|
||||||
}
|
}
|
||||||
func testServerPoolRestartNoDiscovery(t *testing.T, preNeg bool) {
|
func testServerPoolRestartNoDiscovery(t *testing.T, preNeg bool) {
|
||||||
@ -377,8 +403,14 @@ func testServerPoolRestartNoDiscovery(t *testing.T, preNeg bool) {
|
|||||||
s.checkNodes(t, nodes)
|
s.checkNodes(t, nodes)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestServerPoolTrustedNoDiscovery(t *testing.T) { testServerPoolTrustedNoDiscovery(t, false) }
|
func TestServerPoolTrustedNoDiscovery(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
|
testServerPoolTrustedNoDiscovery(t, false)
|
||||||
|
}
|
||||||
func TestServerPoolTrustedNoDiscoveryWithPreNeg(t *testing.T) {
|
func TestServerPoolTrustedNoDiscoveryWithPreNeg(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
testServerPoolTrustedNoDiscovery(t, true)
|
testServerPoolTrustedNoDiscovery(t, true)
|
||||||
}
|
}
|
||||||
func testServerPoolTrustedNoDiscovery(t *testing.T, preNeg bool) {
|
func testServerPoolTrustedNoDiscovery(t *testing.T, preNeg bool) {
|
||||||
|
@ -26,6 +26,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestTransition(t *testing.T) {
|
func TestTransition(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
var epsilon = 0.01
|
var epsilon = 0.01
|
||||||
var cases = []time.Duration{
|
var cases = []time.Duration{
|
||||||
time.Millisecond, minResponseTime,
|
time.Millisecond, minResponseTime,
|
||||||
@ -47,6 +49,8 @@ func TestTransition(t *testing.T) {
|
|||||||
var maxResponseWeights = TimeoutWeights(maxResponseTime)
|
var maxResponseWeights = TimeoutWeights(maxResponseTime)
|
||||||
|
|
||||||
func TestValue(t *testing.T) {
|
func TestValue(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
noexp := utils.ExpirationFactor{Factor: 1}
|
noexp := utils.ExpirationFactor{Factor: 1}
|
||||||
for i := 0; i < 1000; i++ {
|
for i := 0; i < 1000; i++ {
|
||||||
max := minResponseTime + time.Duration(rand.Int63n(int64(maxResponseTime-minResponseTime)))
|
max := minResponseTime + time.Duration(rand.Int63n(int64(maxResponseTime-minResponseTime)))
|
||||||
@ -70,6 +74,8 @@ func TestValue(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestAddSubExpire(t *testing.T) {
|
func TestAddSubExpire(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
var (
|
var (
|
||||||
sum1, sum2 ResponseTimeStats
|
sum1, sum2 ResponseTimeStats
|
||||||
sum1ValueExp, sum2ValueExp float64
|
sum1ValueExp, sum2ValueExp float64
|
||||||
@ -110,6 +116,8 @@ func TestAddSubExpire(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestTimeout(t *testing.T) {
|
func TestTimeout(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
testTimeoutRange(t, 0, time.Second)
|
testTimeoutRange(t, 0, time.Second)
|
||||||
testTimeoutRange(t, time.Second, time.Second*2)
|
testTimeoutRange(t, time.Second, time.Second*2)
|
||||||
testTimeoutRange(t, time.Second, maxResponseTime)
|
testTimeoutRange(t, time.Second, maxResponseTime)
|
||||||
|
@ -38,6 +38,8 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestValueTracker(t *testing.T) {
|
func TestValueTracker(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
db := memorydb.New()
|
db := memorydb.New()
|
||||||
clock := &mclock.Simulated{}
|
clock := &mclock.Simulated{}
|
||||||
requestList := make([]RequestInfo, testReqTypes)
|
requestList := make([]RequestInfo, testReqTypes)
|
||||||
|
@ -37,6 +37,8 @@ var (
|
|||||||
const iterTestNodeCount = 6
|
const iterTestNodeCount = 6
|
||||||
|
|
||||||
func TestWrsIterator(t *testing.T) {
|
func TestWrsIterator(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
ns := nodestate.NewNodeStateMachine(nil, nil, &mclock.Simulated{}, testSetup)
|
ns := nodestate.NewNodeStateMachine(nil, nil, &mclock.Simulated{}, testSetup)
|
||||||
w := NewWrsIterator(ns, sfTest2, sfTest3.Or(sfTest4), sfiTestWeight)
|
w := NewWrsIterator(ns, sfTest2, sfTest3.Or(sfTest4), sfiTestWeight)
|
||||||
ns.Start()
|
ns.Start()
|
||||||
|
@ -107,6 +107,8 @@ func (b *balanceTestSetup) stop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestAddBalance(t *testing.T) {
|
func TestAddBalance(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
b := newBalanceTestSetup(nil, nil, nil)
|
b := newBalanceTestSetup(nil, nil, nil)
|
||||||
defer b.stop()
|
defer b.stop()
|
||||||
|
|
||||||
@ -143,6 +145,8 @@ func TestAddBalance(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestSetBalance(t *testing.T) {
|
func TestSetBalance(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
b := newBalanceTestSetup(nil, nil, nil)
|
b := newBalanceTestSetup(nil, nil, nil)
|
||||||
defer b.stop()
|
defer b.stop()
|
||||||
node := b.newNode(1000)
|
node := b.newNode(1000)
|
||||||
@ -167,6 +171,8 @@ func TestSetBalance(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestBalanceTimeCost(t *testing.T) {
|
func TestBalanceTimeCost(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
b := newBalanceTestSetup(nil, nil, nil)
|
b := newBalanceTestSetup(nil, nil, nil)
|
||||||
defer b.stop()
|
defer b.stop()
|
||||||
node := b.newNode(1000)
|
node := b.newNode(1000)
|
||||||
@ -207,6 +213,8 @@ func TestBalanceTimeCost(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestBalanceReqCost(t *testing.T) {
|
func TestBalanceReqCost(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
b := newBalanceTestSetup(nil, nil, nil)
|
b := newBalanceTestSetup(nil, nil, nil)
|
||||||
defer b.stop()
|
defer b.stop()
|
||||||
node := b.newNode(1000)
|
node := b.newNode(1000)
|
||||||
@ -235,6 +243,8 @@ func TestBalanceReqCost(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestBalanceToPriority(t *testing.T) {
|
func TestBalanceToPriority(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
b := newBalanceTestSetup(nil, nil, nil)
|
b := newBalanceTestSetup(nil, nil, nil)
|
||||||
defer b.stop()
|
defer b.stop()
|
||||||
node := b.newNode(1000)
|
node := b.newNode(1000)
|
||||||
@ -260,6 +270,8 @@ func TestBalanceToPriority(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestEstimatedPriority(t *testing.T) {
|
func TestEstimatedPriority(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
b := newBalanceTestSetup(nil, nil, nil)
|
b := newBalanceTestSetup(nil, nil, nil)
|
||||||
defer b.stop()
|
defer b.stop()
|
||||||
node := b.newNode(1000000000)
|
node := b.newNode(1000000000)
|
||||||
@ -299,6 +311,8 @@ func TestEstimatedPriority(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestPositiveBalanceCounting(t *testing.T) {
|
func TestPositiveBalanceCounting(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
b := newBalanceTestSetup(nil, nil, nil)
|
b := newBalanceTestSetup(nil, nil, nil)
|
||||||
defer b.stop()
|
defer b.stop()
|
||||||
|
|
||||||
@ -340,6 +354,8 @@ func TestPositiveBalanceCounting(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestCallbackChecking(t *testing.T) {
|
func TestCallbackChecking(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
b := newBalanceTestSetup(nil, nil, nil)
|
b := newBalanceTestSetup(nil, nil, nil)
|
||||||
defer b.stop()
|
defer b.stop()
|
||||||
node := b.newNode(1000000)
|
node := b.newNode(1000000)
|
||||||
@ -363,6 +379,8 @@ func TestCallbackChecking(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestCallback(t *testing.T) {
|
func TestCallback(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
b := newBalanceTestSetup(nil, nil, nil)
|
b := newBalanceTestSetup(nil, nil, nil)
|
||||||
defer b.stop()
|
defer b.stop()
|
||||||
node := b.newNode(1000)
|
node := b.newNode(1000)
|
||||||
@ -392,6 +410,8 @@ func TestCallback(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestBalancePersistence(t *testing.T) {
|
func TestBalancePersistence(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
posExp := &utils.Expirer{}
|
posExp := &utils.Expirer{}
|
||||||
negExp := &utils.Expirer{}
|
negExp := &utils.Expirer{}
|
||||||
posExp.SetRate(0, math.Log(2)/float64(time.Hour*2)) // halves every two hours
|
posExp.SetRate(0, math.Log(2)/float64(time.Hour*2)) // halves every two hours
|
||||||
|
@ -32,6 +32,8 @@ func expval(v uint64) utils.ExpiredValue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestNodeDB(t *testing.T) {
|
func TestNodeDB(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
ndb := newNodeDB(rawdb.NewMemoryDatabase(), mclock.System{})
|
ndb := newNodeDB(rawdb.NewMemoryDatabase(), mclock.System{})
|
||||||
defer ndb.close()
|
defer ndb.close()
|
||||||
|
|
||||||
@ -85,6 +87,8 @@ func TestNodeDB(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestNodeDBExpiration(t *testing.T) {
|
func TestNodeDBExpiration(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
var (
|
var (
|
||||||
iterated int
|
iterated int
|
||||||
done = make(chan struct{}, 1)
|
done = make(chan struct{}, 1)
|
||||||
|
@ -32,26 +32,38 @@ import (
|
|||||||
const defaultConnectedBias = time.Minute * 3
|
const defaultConnectedBias = time.Minute * 3
|
||||||
|
|
||||||
func TestClientPoolL10C100Free(t *testing.T) {
|
func TestClientPoolL10C100Free(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
testClientPool(t, 10, 100, 0, true)
|
testClientPool(t, 10, 100, 0, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestClientPoolL40C200Free(t *testing.T) {
|
func TestClientPoolL40C200Free(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
testClientPool(t, 40, 200, 0, true)
|
testClientPool(t, 40, 200, 0, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestClientPoolL100C300Free(t *testing.T) {
|
func TestClientPoolL100C300Free(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
testClientPool(t, 100, 300, 0, true)
|
testClientPool(t, 100, 300, 0, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestClientPoolL10C100P4(t *testing.T) {
|
func TestClientPoolL10C100P4(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
testClientPool(t, 10, 100, 4, false)
|
testClientPool(t, 10, 100, 4, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestClientPoolL40C200P30(t *testing.T) {
|
func TestClientPoolL40C200P30(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
testClientPool(t, 40, 200, 30, false)
|
testClientPool(t, 40, 200, 30, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestClientPoolL100C300P20(t *testing.T) {
|
func TestClientPoolL100C300P20(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
testClientPool(t, 100, 300, 20, false)
|
testClientPool(t, 100, 300, 20, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -244,6 +256,8 @@ func testPriorityConnect(t *testing.T, pool *ClientPool, p *poolTestPeer, cap ui
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestConnectPaidClient(t *testing.T) {
|
func TestConnectPaidClient(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
var (
|
var (
|
||||||
clock mclock.Simulated
|
clock mclock.Simulated
|
||||||
db = rawdb.NewMemoryDatabase()
|
db = rawdb.NewMemoryDatabase()
|
||||||
@ -260,6 +274,8 @@ func TestConnectPaidClient(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestConnectPaidClientToSmallPool(t *testing.T) {
|
func TestConnectPaidClientToSmallPool(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
var (
|
var (
|
||||||
clock mclock.Simulated
|
clock mclock.Simulated
|
||||||
db = rawdb.NewMemoryDatabase()
|
db = rawdb.NewMemoryDatabase()
|
||||||
@ -278,6 +294,8 @@ func TestConnectPaidClientToSmallPool(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestConnectPaidClientToFullPool(t *testing.T) {
|
func TestConnectPaidClientToFullPool(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
var (
|
var (
|
||||||
clock mclock.Simulated
|
clock mclock.Simulated
|
||||||
db = rawdb.NewMemoryDatabase()
|
db = rawdb.NewMemoryDatabase()
|
||||||
@ -304,6 +322,8 @@ func TestConnectPaidClientToFullPool(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestPaidClientKickedOut(t *testing.T) {
|
func TestPaidClientKickedOut(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
var (
|
var (
|
||||||
clock mclock.Simulated
|
clock mclock.Simulated
|
||||||
db = rawdb.NewMemoryDatabase()
|
db = rawdb.NewMemoryDatabase()
|
||||||
@ -337,6 +357,8 @@ func TestPaidClientKickedOut(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestConnectFreeClient(t *testing.T) {
|
func TestConnectFreeClient(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
var (
|
var (
|
||||||
clock mclock.Simulated
|
clock mclock.Simulated
|
||||||
db = rawdb.NewMemoryDatabase()
|
db = rawdb.NewMemoryDatabase()
|
||||||
@ -353,6 +375,8 @@ func TestConnectFreeClient(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestConnectFreeClientToFullPool(t *testing.T) {
|
func TestConnectFreeClientToFullPool(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
var (
|
var (
|
||||||
clock mclock.Simulated
|
clock mclock.Simulated
|
||||||
db = rawdb.NewMemoryDatabase()
|
db = rawdb.NewMemoryDatabase()
|
||||||
@ -381,6 +405,8 @@ func TestConnectFreeClientToFullPool(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestFreeClientKickedOut(t *testing.T) {
|
func TestFreeClientKickedOut(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
var (
|
var (
|
||||||
clock mclock.Simulated
|
clock mclock.Simulated
|
||||||
db = rawdb.NewMemoryDatabase()
|
db = rawdb.NewMemoryDatabase()
|
||||||
@ -425,6 +451,8 @@ func TestFreeClientKickedOut(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestPositiveBalanceCalculation(t *testing.T) {
|
func TestPositiveBalanceCalculation(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
var (
|
var (
|
||||||
clock mclock.Simulated
|
clock mclock.Simulated
|
||||||
db = rawdb.NewMemoryDatabase()
|
db = rawdb.NewMemoryDatabase()
|
||||||
@ -448,6 +476,8 @@ func TestPositiveBalanceCalculation(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestDowngradePriorityClient(t *testing.T) {
|
func TestDowngradePriorityClient(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
var (
|
var (
|
||||||
clock mclock.Simulated
|
clock mclock.Simulated
|
||||||
db = rawdb.NewMemoryDatabase()
|
db = rawdb.NewMemoryDatabase()
|
||||||
@ -484,6 +514,8 @@ func TestDowngradePriorityClient(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestNegativeBalanceCalculation(t *testing.T) {
|
func TestNegativeBalanceCalculation(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
var (
|
var (
|
||||||
clock mclock.Simulated
|
clock mclock.Simulated
|
||||||
db = rawdb.NewMemoryDatabase()
|
db = rawdb.NewMemoryDatabase()
|
||||||
@ -523,6 +555,8 @@ func TestNegativeBalanceCalculation(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestInactiveClient(t *testing.T) {
|
func TestInactiveClient(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
var (
|
var (
|
||||||
clock mclock.Simulated
|
clock mclock.Simulated
|
||||||
db = rawdb.NewMemoryDatabase()
|
db = rawdb.NewMemoryDatabase()
|
||||||
|
@ -48,6 +48,8 @@ func (c *ppTestClient) estimatePriority(cap uint64, addBalance int64, future, bi
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestPriorityPool(t *testing.T) {
|
func TestPriorityPool(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
clock := &mclock.Simulated{}
|
clock := &mclock.Simulated{}
|
||||||
setup := newServerSetup()
|
setup := newServerSetup()
|
||||||
setup.balanceField = setup.setup.NewField("ppTestClient", reflect.TypeOf(&ppTestClient{}))
|
setup.balanceField = setup.setup.NewField("ppTestClient", reflect.TypeOf(&ppTestClient{}))
|
||||||
@ -160,6 +162,8 @@ func TestPriorityPool(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestCapacityCurve(t *testing.T) {
|
func TestCapacityCurve(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
clock := &mclock.Simulated{}
|
clock := &mclock.Simulated{}
|
||||||
setup := newServerSetup()
|
setup := newServerSetup()
|
||||||
setup.balanceField = setup.setup.NewField("ppTestClient", reflect.TypeOf(&ppTestClient{}))
|
setup.balanceField = setup.setup.NewField("ppTestClient", reflect.TypeOf(&ppTestClient{}))
|
||||||
|
Loading…
Reference in New Issue
Block a user