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

core/services: more parallel tests #15762

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ func (m *MockReadCloser) Close() error {
}

func Test_ChannelDefinitionCache_Integration(t *testing.T) {
t.Parallel()
var (
invalidDefinitions = []byte(`{{{`)
invalidDefinitionsSHA = sha3.Sum256(invalidDefinitions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import (
)

func TestFilterNamesFromSpec21(t *testing.T) {
t.Parallel()
b := make([]byte, 20)
_, err := crand.Read(b)
require.NoError(t, err)
Expand All @@ -85,6 +86,7 @@ func TestFilterNamesFromSpec21(t *testing.T) {
}

func TestIntegration_KeeperPluginConditionalUpkeep(t *testing.T) {
t.Parallel()
g := gomega.NewWithT(t)
lggr := logger.TestLogger(t)

Expand Down Expand Up @@ -182,6 +184,7 @@ func TestIntegration_KeeperPluginConditionalUpkeep(t *testing.T) {

func TestIntegration_KeeperPluginLogUpkeep(t *testing.T) {
t.Skip("fails after geth upgrade https://github.com/smartcontractkit/chainlink/pull/11809; DEPENDENT ON SPECIFIC BLOCK PATTTERN?")
t.Parallel()
g := gomega.NewWithT(t)

// setup blockchain
Expand Down Expand Up @@ -275,6 +278,7 @@ func TestIntegration_KeeperPluginLogUpkeep(t *testing.T) {
}

func TestIntegration_KeeperPluginLogUpkeep_Retry(t *testing.T) {
t.Parallel()
g := gomega.NewWithT(t)

// setup blockchain
Expand Down Expand Up @@ -395,6 +399,7 @@ func TestIntegration_KeeperPluginLogUpkeep_Retry(t *testing.T) {
}

func TestIntegration_KeeperPluginLogUpkeep_ErrHandler(t *testing.T) {
t.Parallel()
g := gomega.NewWithT(t)

// setup blockchain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ func (m *testWorkflowRegistryContractLoader) LoadWorkflows(ctx context.Context,
}

func Test_EventHandlerStateSync(t *testing.T) {
t.Parallel()
lggr := logger.TestLogger(t)
backendTH := testutils.NewEVMBackendTH(t)
donID := uint32(1)
Expand Down Expand Up @@ -220,6 +221,7 @@ func Test_EventHandlerStateSync(t *testing.T) {
}

func Test_InitialStateSync(t *testing.T) {
t.Parallel()
lggr := logger.TestLogger(t)
backendTH := testutils.NewEVMBackendTH(t)
donID := uint32(1)
Expand Down Expand Up @@ -284,6 +286,7 @@ func Test_InitialStateSync(t *testing.T) {
}

func Test_SecretsWorker(t *testing.T) {
t.Parallel()
var (
ctx = coretestutils.Context(t)
lggr = logger.TestLogger(t)
Expand Down Expand Up @@ -384,6 +387,7 @@ func Test_SecretsWorker(t *testing.T) {
}

func Test_RegistrySyncer_WorkflowRegistered_InitiallyPaused(t *testing.T) {
t.Parallel()
var (
ctx = coretestutils.Context(t)
lggr = logger.TestLogger(t)
Expand Down Expand Up @@ -481,6 +485,7 @@ func (m *mockEngineFactory) new(ctx context.Context, wfid string, owner string,
}

func Test_RegistrySyncer_WorkflowRegistered_InitiallyActivated(t *testing.T) {
t.Parallel()
var (
ctx = coretestutils.Context(t)
lggr = logger.TestLogger(t)
Expand Down
1 change: 1 addition & 0 deletions core/services/relay/evm/functions/config_poller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
)

func TestFunctionsConfigPoller(t *testing.T) {
t.Parallel()
t.Run("FunctionsPlugin", func(t *testing.T) {
runTest(t, functions.FunctionsPlugin, functions.FunctionsDigestPrefix)
})
Expand Down
1 change: 1 addition & 0 deletions core/services/relay/evm/mercury/config_digest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
// Adapted from: https://github.com/smartcontractkit/offchain-reporting/blob/991ebe1462fd56826a1ddfb34287d542acb2baee/lib/offchainreporting2/chains/evmutil/config_digest_test.go

func TestConfigCalculationMatches(t *testing.T) {
t.Parallel()
key, err := crypto.GenerateKey()
require.NoError(t, err, "could not make private key for EOA owner")
owner, err := bind.NewKeyedTransactorWithChainID(key, big.NewInt(1337))
Expand Down
1 change: 1 addition & 0 deletions core/services/relay/evm/mercury/config_poller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
)

func TestMercuryConfigPoller(t *testing.T) {
t.Parallel()
feedID := evmutils.NewHash()
feedIDBytes := [32]byte(feedID)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
)

func Test_OffchainConfigDigester_ConfigDigest(t *testing.T) {
t.Parallel()
ctx := tests.Context(t)
// ChainID and ContractAddress are taken into account for computation
cd1, err := OffchainConfigDigester{ChainID: big.NewInt(0)}.ConfigDigest(ctx, types.ContractConfig{})
Expand Down
4 changes: 4 additions & 0 deletions core/services/relay/evm/mercury/orm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var (
)

func TestORM(t *testing.T) {
t.Parallel()
ctx := testutils.Context(t)
db := pgtest.NewSqlxDB(t)

Expand Down Expand Up @@ -151,6 +152,7 @@ func TestORM(t *testing.T) {
}

func TestORM_InsertTransmitRequest_MultipleServerURLs(t *testing.T) {
t.Parallel()
ctx := testutils.Context(t)
db := pgtest.NewSqlxDB(t)

Expand Down Expand Up @@ -196,6 +198,7 @@ func TestORM_InsertTransmitRequest_MultipleServerURLs(t *testing.T) {
}

func TestORM_PruneTransmitRequests(t *testing.T) {
t.Parallel()
ctx := testutils.Context(t)
db := pgtest.NewSqlxDB(t)
jobID := rand.Int32() // foreign key constraints disabled so value doesn't matter
Expand Down Expand Up @@ -289,6 +292,7 @@ func TestORM_PruneTransmitRequests(t *testing.T) {
}

func TestORM_InsertTransmitRequest_LatestReport(t *testing.T) {
t.Parallel()
ctx := testutils.Context(t)
db := pgtest.NewSqlxDB(t)
jobID := rand.Int32() // foreign key constraints disabled so value doesn't matter
Expand Down
3 changes: 3 additions & 0 deletions core/services/relay/evm/mercury/persistence_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func bootstrapPersistenceManager(t *testing.T, jobID int32, db *sqlx.DB) (*Persi
}

func TestPersistenceManager(t *testing.T) {
t.Parallel()
jobID1 := rand.Int32()
jobID2 := jobID1 + 1

Expand Down Expand Up @@ -69,6 +70,7 @@ func TestPersistenceManager(t *testing.T) {
}

func TestPersistenceManagerAsyncDelete(t *testing.T) {
t.Parallel()
ctx := testutils.Context(t)
jobID := rand.Int32()
db := pgtest.NewSqlxDB(t)
Expand Down Expand Up @@ -114,6 +116,7 @@ func TestPersistenceManagerAsyncDelete(t *testing.T) {
}

func TestPersistenceManagerPrune(t *testing.T) {
t.Parallel()
jobID1 := rand.Int32()
jobID2 := jobID1 + 1
db := pgtest.NewSqlxDB(t)
Expand Down
3 changes: 3 additions & 0 deletions core/services/relay/evm/mercury/transmitter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func (m mockCfg) TransmitTimeout() commonconfig.Duration {
}

func Test_MercuryTransmitter_Transmit(t *testing.T) {
t.Parallel()
lggr := logger.TestLogger(t)
db := pgtest.NewSqlxDB(t)
var jobID int32
Expand Down Expand Up @@ -403,6 +404,7 @@ func Test_MercuryTransmitter_FetchInitialMaxFinalizedBlockNumber(t *testing.T) {
}

func Test_sortReportsLatestFirst(t *testing.T) {
t.Parallel()
reports := []*pb.Report{
nil,
{ObservationsTimestamp: 1},
Expand Down Expand Up @@ -457,6 +459,7 @@ func (m *mockQ) Init(transmissions []*Transmission) {}
func (m *mockQ) IsEmpty() bool { return false }

func Test_MercuryTransmitter_runQueueLoop(t *testing.T) {
t.Parallel()
feedIDHex := utils.NewHash().Hex()
lggr := logger.TestLogger(t)
c := &mocks.MockWSRPCClient{}
Expand Down
Loading