dev: fix: tests failing due to t.Parallel

This commit is contained in:
marcello33 2023-06-21 15:03:16 +02:00
parent ba61cfa2e1
commit 43e114beda
5 changed files with 7 additions and 12 deletions

View file

@ -1080,7 +1080,6 @@ func TestQueueGlobalLimitingNoLocals(t *testing.T) {
func testQueueGlobalLimiting(t *testing.T, nolocals bool) { func testQueueGlobalLimiting(t *testing.T, nolocals bool) {
t.Helper() t.Helper()
t.Parallel()
// Create the pool to test the limit enforcement with // Create the pool to test the limit enforcement with
statedb, _ := state.New(common.Hash{}, state.NewDatabase(rawdb.NewMemoryDatabase()), nil) statedb, _ := state.New(common.Hash{}, state.NewDatabase(rawdb.NewMemoryDatabase()), nil)

View file

@ -98,7 +98,7 @@ func TestForkIDSplit68(t *testing.T) {
} }
func testForkIDSplit(t *testing.T, protocol uint) { func testForkIDSplit(t *testing.T, protocol uint) {
t.Parallel() t.Helper()
var ( var (
engine = ethash.NewFaker() engine = ethash.NewFaker()
@ -268,7 +268,7 @@ func TestRecvTransactions68(t *testing.T) {
} }
func testRecvTransactions(t *testing.T, protocol uint) { func testRecvTransactions(t *testing.T, protocol uint) {
t.Parallel() t.Helper()
// Create a message handler, configure it to accept transactions and watch them // Create a message handler, configure it to accept transactions and watch them
handler := newTestHandler() handler := newTestHandler()
@ -442,7 +442,7 @@ func TestTransactionPropagation68(t *testing.T) {
} }
func testTransactionPropagation(t *testing.T, protocol uint) { func testTransactionPropagation(t *testing.T, protocol uint) {
t.Parallel() t.Helper()
// Create a source handler to send transactions from and a number of sinks // Create a source handler to send transactions from and a number of sinks
// to receive them. We need multiple sinks since a one-to-one peering would // to receive them. We need multiple sinks since a one-to-one peering would
@ -774,7 +774,7 @@ func TestBroadcastMalformedBlock68(t *testing.T) {
} }
func testBroadcastMalformedBlock(t *testing.T, protocol uint) { func testBroadcastMalformedBlock(t *testing.T, protocol uint) {
t.Parallel() t.Helper()
// Create a source handler to broadcast blocks from and a number of sinks // Create a source handler to broadcast blocks from and a number of sinks
// to receive them. // to receive them.

View file

@ -165,7 +165,7 @@ func TestGetBlockHeaders68(t *testing.T) {
} }
func testGetBlockHeaders(t *testing.T, protocol uint) { func testGetBlockHeaders(t *testing.T, protocol uint) {
t.Parallel() t.Helper()
backend := newTestBackend(maxHeadersServe + 15) backend := newTestBackend(maxHeadersServe + 15)
defer backend.close() defer backend.close()
@ -365,8 +365,6 @@ func TestGetBlockBodies68(t *testing.T) {
} }
func testGetBlockBodies(t *testing.T, protocol uint) { func testGetBlockBodies(t *testing.T, protocol uint) {
t.Parallel()
gen := func(n int, g *core.BlockGen) { gen := func(n int, g *core.BlockGen) {
if n%2 == 0 { if n%2 == 0 {
w := &types.Withdrawal{ w := &types.Withdrawal{
@ -613,7 +611,7 @@ func TestGetBlockReceipts68(t *testing.T) {
} }
func testGetBlockReceipts(t *testing.T, protocol uint) { func testGetBlockReceipts(t *testing.T, protocol uint) {
t.Parallel() t.Helper()
// Define three accounts to simulate transactions with // Define three accounts to simulate transactions with
acc1Key, _ := crypto.HexToECDSA("8a1f9a8f95be41cd7ccb6168179afb4504aefe388d1e14474d32c45c72ce7b7a") acc1Key, _ := crypto.HexToECDSA("8a1f9a8f95be41cd7ccb6168179afb4504aefe388d1e14474d32c45c72ce7b7a")

View file

@ -22,9 +22,8 @@ import (
"testing" "testing"
) )
// nolint:paralleltest
func TestPathExpansion(t *testing.T) { func TestPathExpansion(t *testing.T) {
t.Parallel()
user, _ := user.Current() user, _ := user.Current()
var tests map[string]string var tests map[string]string

View file

@ -207,7 +207,6 @@ func TestAuthEndpoints(t *testing.T) {
} }
for _, testCase := range testCases { for _, testCase := range testCases {
t.Parallel()
t.Run(testCase.name, testCase.Run) t.Run(testCase.name, testCase.Run)
} }
} }