From a5ecc51745d0fd48fa34ea55cc0224f6dd541c8f Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Wed, 18 Dec 2024 15:05:20 -0600 Subject: [PATCH] core/services: more parallel tests --- .../llo/onchain_channel_definition_cache_integration_test.go | 1 + core/services/ocr2/plugins/ocr2keeper/integration_21_test.go | 5 +++++ .../capabilities/workflows/syncer/workflow_syncer_test.go | 5 +++++ core/services/relay/evm/functions/config_poller_test.go | 1 + core/services/relay/evm/mercury/config_digest_test.go | 1 + core/services/relay/evm/mercury/config_poller_test.go | 1 + .../relay/evm/mercury/offchain_config_digester_test.go | 1 + core/services/relay/evm/mercury/orm_test.go | 4 ++++ core/services/relay/evm/mercury/persistence_manager_test.go | 3 +++ core/services/relay/evm/mercury/transmitter_test.go | 3 +++ 10 files changed, 25 insertions(+) diff --git a/core/services/ocr2/plugins/llo/onchain_channel_definition_cache_integration_test.go b/core/services/ocr2/plugins/llo/onchain_channel_definition_cache_integration_test.go index e94301cf98d..16201959d22 100644 --- a/core/services/ocr2/plugins/llo/onchain_channel_definition_cache_integration_test.go +++ b/core/services/ocr2/plugins/llo/onchain_channel_definition_cache_integration_test.go @@ -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) diff --git a/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go b/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go index e941044e91a..aa30a44c6e5 100644 --- a/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go @@ -59,6 +59,7 @@ import ( ) func TestFilterNamesFromSpec21(t *testing.T) { + t.Parallel() b := make([]byte, 20) _, err := crand.Read(b) require.NoError(t, err) @@ -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) @@ -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 @@ -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 @@ -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 diff --git a/core/services/relay/evm/capabilities/workflows/syncer/workflow_syncer_test.go b/core/services/relay/evm/capabilities/workflows/syncer/workflow_syncer_test.go index 48b805295ff..58681fca725 100644 --- a/core/services/relay/evm/capabilities/workflows/syncer/workflow_syncer_test.go +++ b/core/services/relay/evm/capabilities/workflows/syncer/workflow_syncer_test.go @@ -93,6 +93,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) @@ -221,6 +222,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) @@ -285,6 +287,7 @@ func Test_InitialStateSync(t *testing.T) { } func Test_SecretsWorker(t *testing.T) { + t.Parallel() var ( ctx = coretestutils.Context(t) lggr = logger.TestLogger(t) @@ -385,6 +388,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) @@ -482,6 +486,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) diff --git a/core/services/relay/evm/functions/config_poller_test.go b/core/services/relay/evm/functions/config_poller_test.go index ca280fd80b0..2a50c4c82bd 100644 --- a/core/services/relay/evm/functions/config_poller_test.go +++ b/core/services/relay/evm/functions/config_poller_test.go @@ -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) }) diff --git a/core/services/relay/evm/mercury/config_digest_test.go b/core/services/relay/evm/mercury/config_digest_test.go index 600eb8c88d5..c736b235b5d 100644 --- a/core/services/relay/evm/mercury/config_digest_test.go +++ b/core/services/relay/evm/mercury/config_digest_test.go @@ -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)) diff --git a/core/services/relay/evm/mercury/config_poller_test.go b/core/services/relay/evm/mercury/config_poller_test.go index 2eb6be25910..21646e15024 100644 --- a/core/services/relay/evm/mercury/config_poller_test.go +++ b/core/services/relay/evm/mercury/config_poller_test.go @@ -21,6 +21,7 @@ import ( ) func TestMercuryConfigPoller(t *testing.T) { + t.Parallel() feedID := evmutils.NewHash() feedIDBytes := [32]byte(feedID) diff --git a/core/services/relay/evm/mercury/offchain_config_digester_test.go b/core/services/relay/evm/mercury/offchain_config_digester_test.go index 62869cf6f3d..7fb57e44364 100644 --- a/core/services/relay/evm/mercury/offchain_config_digester_test.go +++ b/core/services/relay/evm/mercury/offchain_config_digester_test.go @@ -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{}) diff --git a/core/services/relay/evm/mercury/orm_test.go b/core/services/relay/evm/mercury/orm_test.go index f3ff70cdced..20c0cee3997 100644 --- a/core/services/relay/evm/mercury/orm_test.go +++ b/core/services/relay/evm/mercury/orm_test.go @@ -20,6 +20,7 @@ var ( ) func TestORM(t *testing.T) { + t.Parallel() ctx := testutils.Context(t) db := pgtest.NewSqlxDB(t) @@ -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) @@ -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 @@ -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 diff --git a/core/services/relay/evm/mercury/persistence_manager_test.go b/core/services/relay/evm/mercury/persistence_manager_test.go index 1ba999614a6..e3e16cc9972 100644 --- a/core/services/relay/evm/mercury/persistence_manager_test.go +++ b/core/services/relay/evm/mercury/persistence_manager_test.go @@ -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 @@ -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) @@ -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) diff --git a/core/services/relay/evm/mercury/transmitter_test.go b/core/services/relay/evm/mercury/transmitter_test.go index 70ee8fca74f..63339e2657b 100644 --- a/core/services/relay/evm/mercury/transmitter_test.go +++ b/core/services/relay/evm/mercury/transmitter_test.go @@ -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 @@ -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}, @@ -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{}