Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: Fix t.Parallel() errors in netdeploy package #4993

Merged
merged 6 commits into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,6 @@ issues:
- path: ^logging.*_test\.go
linters:
- paralleltest
- path: ^netdeploy.*_test\.go
linters:
- paralleltest
- path: ^network.*_test\.go
linters:
- paralleltest
Expand Down
6 changes: 6 additions & 0 deletions netdeploy/networkTemplates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (

func TestLoadConfig(t *testing.T) {
partitiontest.PartitionTest(t)
t.Parallel()

a := require.New(t)

Expand All @@ -44,6 +45,7 @@ func TestLoadConfig(t *testing.T) {

func TestLoadMissingConfig(t *testing.T) {
partitiontest.PartitionTest(t)
t.Parallel()

a := require.New(t)

Expand All @@ -55,6 +57,7 @@ func TestLoadMissingConfig(t *testing.T) {

func TestGenerateGenesis(t *testing.T) {
partitiontest.PartitionTest(t)
t.Parallel()

a := require.New(t)

Expand All @@ -74,6 +77,7 @@ func TestGenerateGenesis(t *testing.T) {

func TestValidate(t *testing.T) {
partitiontest.PartitionTest(t)
t.Parallel()

a := require.New(t)

Expand Down Expand Up @@ -106,6 +110,8 @@ type overlayTestStruct struct {
// TestJsonOverlay ensures that encoding/json will only clobber fields present in the json and leave other fields unchanged
func TestJsonOverlay(t *testing.T) {
partitiontest.PartitionTest(t)
t.Parallel()

before := overlayTestStruct{A: "one", B: "two"}
setB := "{\"B\":\"other\"}"
dec := json.NewDecoder(strings.NewReader(setB))
Expand Down
2 changes: 2 additions & 0 deletions netdeploy/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (

func TestSaveNetworkCfg(t *testing.T) {
partitiontest.PartitionTest(t)
t.Parallel()

a := require.New(t)

Expand All @@ -48,6 +49,7 @@ func TestSaveNetworkCfg(t *testing.T) {

func TestSaveConsensus(t *testing.T) {
partitiontest.PartitionTest(t)
t.Parallel()

a := require.New(t)

Expand Down
1 change: 1 addition & 0 deletions netdeploy/remote/bootstrappedNetwork_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (

func TestLoadBootstrappedData(t *testing.T) {
partitiontest.PartitionTest(t)
t.Parallel()

badSpecPath := filepath.Join("./../../test", "testdata/deployednettemplates/networks/bootstrapped/badSpec.json")
_, err := LoadBootstrappedData(badSpecPath)
Expand Down
3 changes: 3 additions & 0 deletions netdeploy/remote/deployedNetwork_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (

func TestCreateSignedTxBasic(t *testing.T) {
partitiontest.PartitionTest(t)
t.Parallel()

var networkState netState
networkState.nApplications = 2
Expand Down Expand Up @@ -90,6 +91,7 @@ func TestCreateSignedTxBasic(t *testing.T) {
func TestCreateSignedTxAssets(t *testing.T) {
// assets per account should not exceed limit
partitiontest.PartitionTest(t)
t.Parallel()

params := config.Consensus[protocol.ConsensusCurrentVersion]
secretDst := keypair()
Expand Down Expand Up @@ -127,6 +129,7 @@ func TestCreateSignedTxAssets(t *testing.T) {

func TestAccountsNeeded(t *testing.T) {
partitiontest.PartitionTest(t)
t.Parallel()

params := config.Consensus[protocol.ConsensusCurrentVersion]
params.MaxAppsCreated = 10
Expand Down