Skip to content

Commit

Permalink
Randomize database names when using heavyweight ORM (#11233)
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-cordenier authored Nov 8, 2023
1 parent 027068e commit 4ccd1c5
Show file tree
Hide file tree
Showing 24 changed files with 92 additions and 107 deletions.
6 changes: 3 additions & 3 deletions core/chains/evm/logpoller/log_poller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func populateDatabase(t testing.TB, o *logpoller.DbORM, chainID *big.Int) (commo

func BenchmarkSelectLogsCreatedAfter(b *testing.B) {
chainId := big.NewInt(137)
_, db := heavyweight.FullTestDBV2(b, "logs_scale", nil)
_, db := heavyweight.FullTestDBV2(b, nil)
o := logpoller.NewORM(chainId, db, logger.TestLogger(b), pgtest.NewQConfig(false))
event, address, _ := populateDatabase(b, o, chainId)

Expand All @@ -103,7 +103,7 @@ func BenchmarkSelectLogsCreatedAfter(b *testing.B) {

func TestPopulateLoadedDB(t *testing.T) {
t.Skip("Only for local load testing and query analysis")
_, db := heavyweight.FullTestDBV2(t, "logs_scale", nil)
_, db := heavyweight.FullTestDBV2(t, nil)
chainID := big.NewInt(137)

o := logpoller.NewORM(big.NewInt(137), db, logger.TestLogger(t), pgtest.NewQConfig(true))
Expand Down Expand Up @@ -1328,7 +1328,7 @@ func TestNotifyAfterInsert(t *testing.T) {
// Use a non-transactional db for this test because notify events
// are not delivered until the transaction is committed.
var dbURL string
_, sqlxDB := heavyweight.FullTestDBV2(t, "notify_after_insert_log", func(c *chainlink.Config, s *chainlink.Secrets) {
_, sqlxDB := heavyweight.FullTestDBV2(t, func(c *chainlink.Config, s *chainlink.Secrets) {
dbURL = s.Database.URL.URL().String()
})

Expand Down
4 changes: 2 additions & 2 deletions core/chains/evm/txmgr/broadcaster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func NewTestEthBroadcaster(
}

func TestEthBroadcaster_Lifecycle(t *testing.T) {
cfg, db := heavyweight.FullTestDBV2(t, "eth_broadcaster_optimistic_locking", nil)
cfg, db := heavyweight.FullTestDBV2(t, nil)
txStore := cltest.NewTestTxStore(t, db, cfg.Database())
evmcfg := evmtest.NewChainScopedConfig(t, cfg)
ethClient := evmtest.NewEthClientMockWithDefaultChain(t)
Expand Down Expand Up @@ -565,7 +565,7 @@ func TestEthBroadcaster_TransmitChecking(t *testing.T) {

func TestEthBroadcaster_ProcessUnstartedEthTxs_OptimisticLockingOnEthTx(t *testing.T) {
// non-transactional DB needed because we deliberately test for FK violation
cfg, db := heavyweight.FullTestDBV2(t, "eth_broadcaster_optimistic_locking", nil)
cfg, db := heavyweight.FullTestDBV2(t, nil)
txStore := cltest.NewTestTxStore(t, db, cfg.Database())
ccfg := evmtest.NewChainScopedConfig(t, cfg)
evmcfg := txmgr.NewEvmTxmConfig(ccfg.EVM())
Expand Down
6 changes: 3 additions & 3 deletions core/cmd/shell_local_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func TestShell_RebroadcastTransactions_Txm(t *testing.T) {
// Use a non-transactional db for this test because we need to
// test multiple connections to the database, and changes made within
// the transaction cannot be seen from another connection.
config, sqlxDB := heavyweight.FullTestDBV2(t, "rebroadcasttransactions", func(c *chainlink.Config, s *chainlink.Secrets) {
config, sqlxDB := heavyweight.FullTestDBV2(t, func(c *chainlink.Config, s *chainlink.Secrets) {
c.Database.Dialect = dialects.Postgres
// evm config is used in this test. but if set, it must be pass config validation.
// simplest to make it nil
Expand Down Expand Up @@ -359,7 +359,7 @@ func TestShell_RebroadcastTransactions_OutsideRange_Txm(t *testing.T) {
// Use the non-transactional db for this test because we need to
// test multiple connections to the database, and changes made within
// the transaction cannot be seen from another connection.
config, sqlxDB := heavyweight.FullTestDBV2(t, "rebroadcasttransactions_outsiderange", func(c *chainlink.Config, s *chainlink.Secrets) {
config, sqlxDB := heavyweight.FullTestDBV2(t, func(c *chainlink.Config, s *chainlink.Secrets) {
c.Database.Dialect = dialects.Postgres
// evm config is used in this test. but if set, it must be pass config validation.
// simplest to make it nil
Expand Down Expand Up @@ -437,7 +437,7 @@ func TestShell_RebroadcastTransactions_AddressCheck(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {

config, sqlxDB := heavyweight.FullTestDBV2(t, "rebroadcasttransactions_outsiderange", func(c *chainlink.Config, s *chainlink.Secrets) {
config, sqlxDB := heavyweight.FullTestDBV2(t, func(c *chainlink.Config, s *chainlink.Secrets) {
c.Database.Dialect = dialects.Postgres

c.EVM = nil
Expand Down
24 changes: 14 additions & 10 deletions core/internal/cltest/heavyweight/orm.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ import (
"database/sql"
"errors"
"fmt"
"math/rand"
"net/url"
"os"
"path"
"runtime"
"strings"
"testing"

"github.com/google/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand All @@ -30,21 +31,25 @@ import (

// FullTestDBV2 creates a pristine DB which runs in a separate database than the normal
// unit tests, so you can do things like use other Postgres connection types with it.
func FullTestDBV2(t testing.TB, name string, overrideFn func(c *chainlink.Config, s *chainlink.Secrets)) (chainlink.GeneralConfig, *sqlx.DB) {
return prepareFullTestDBV2(t, name, false, true, overrideFn)
func FullTestDBV2(t testing.TB, overrideFn func(c *chainlink.Config, s *chainlink.Secrets)) (chainlink.GeneralConfig, *sqlx.DB) {
return prepareFullTestDBV2(t, false, true, overrideFn)
}

// FullTestDBNoFixturesV2 is the same as FullTestDB, but it does not load fixtures.
func FullTestDBNoFixturesV2(t testing.TB, name string, overrideFn func(c *chainlink.Config, s *chainlink.Secrets)) (chainlink.GeneralConfig, *sqlx.DB) {
return prepareFullTestDBV2(t, name, false, false, overrideFn)
func FullTestDBNoFixturesV2(t testing.TB, overrideFn func(c *chainlink.Config, s *chainlink.Secrets)) (chainlink.GeneralConfig, *sqlx.DB) {
return prepareFullTestDBV2(t, false, false, overrideFn)
}

// FullTestDBEmptyV2 creates an empty DB (without migrations).
func FullTestDBEmptyV2(t testing.TB, name string, overrideFn func(c *chainlink.Config, s *chainlink.Secrets)) (chainlink.GeneralConfig, *sqlx.DB) {
return prepareFullTestDBV2(t, name, true, false, overrideFn)
func FullTestDBEmptyV2(t testing.TB, overrideFn func(c *chainlink.Config, s *chainlink.Secrets)) (chainlink.GeneralConfig, *sqlx.DB) {
return prepareFullTestDBV2(t, true, false, overrideFn)
}

func prepareFullTestDBV2(t testing.TB, name string, empty bool, loadFixtures bool, overrideFn func(c *chainlink.Config, s *chainlink.Secrets)) (chainlink.GeneralConfig, *sqlx.DB) {
func generateName() string {
return strings.ReplaceAll(uuid.New().String(), "-", "")
}

func prepareFullTestDBV2(t testing.TB, empty bool, loadFixtures bool, overrideFn func(c *chainlink.Config, s *chainlink.Secrets)) (chainlink.GeneralConfig, *sqlx.DB) {
testutils.SkipShort(t, "FullTestDB")

if empty && loadFixtures {
Expand All @@ -59,8 +64,7 @@ func prepareFullTestDBV2(t testing.TB, name string, empty bool, loadFixtures boo
})

require.NoError(t, os.MkdirAll(gcfg.RootDir(), 0700))
name = fmt.Sprintf("%s_%x", name, rand.Intn(0xFFF)) // to avoid name collisions
migrationTestDBURL, err := dropAndCreateThrowawayTestDB(gcfg.Database().URL(), name, empty)
migrationTestDBURL, err := dropAndCreateThrowawayTestDB(gcfg.Database().URL(), generateName(), empty)
require.NoError(t, err)
db, err := pg.NewConnection(migrationTestDBURL, dialects.Postgres, gcfg.Database())
require.NoError(t, err)
Expand Down
15 changes: 7 additions & 8 deletions core/internal/features/features_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -675,11 +675,11 @@ func setupOCRContracts(t *testing.T) (*bind.TransactOpts, *backends.SimulatedBac
return owner, b, ocrContractAddress, ocrContract, flagsContract, flagsContractAddress
}

func setupNode(t *testing.T, owner *bind.TransactOpts, portV1, portV2 int, dbName string,
func setupNode(t *testing.T, owner *bind.TransactOpts, portV1, portV2 int,
b *backends.SimulatedBackend, ns ocrnetworking.NetworkingStack, overrides func(c *chainlink.Config, s *chainlink.Secrets),
) (*cltest.TestApplication, string, common.Address, ocrkey.KeyV2) {
p2pKey := keystest.NewP2PKeyV2(t)
config, _ := heavyweight.FullTestDBV2(t, dbName, func(c *chainlink.Config, s *chainlink.Secrets) {
config, _ := heavyweight.FullTestDBV2(t, func(c *chainlink.Config, s *chainlink.Secrets) {
c.Insecure.OCRDevelopmentMode = ptr(true) // Disables ocr spec validation so we can have fast polling for the test.

c.OCR.Enabled = ptr(true)
Expand Down Expand Up @@ -748,7 +748,6 @@ func setupForwarderEnabledNode(
owner *bind.TransactOpts,
portV1,
portV2 int,
dbName string,
b *backends.SimulatedBackend,
ns ocrnetworking.NetworkingStack,
overrides func(c *chainlink.Config, s *chainlink.Secrets),
Expand All @@ -760,7 +759,7 @@ func setupForwarderEnabledNode(
ocrkey.KeyV2,
) {
p2pKey := keystest.NewP2PKeyV2(t)
config, _ := heavyweight.FullTestDBV2(t, dbName, func(c *chainlink.Config, s *chainlink.Secrets) {
config, _ := heavyweight.FullTestDBV2(t, func(c *chainlink.Config, s *chainlink.Secrets) {
c.Insecure.OCRDevelopmentMode = ptr(true) // Disables ocr spec validation so we can have fast polling for the test.

c.OCR.Enabled = ptr(true)
Expand Down Expand Up @@ -867,7 +866,7 @@ func TestIntegration_OCR(t *testing.T) {

// Note it's plausible these ports could be occupied on a CI machine.
// May need a port randomize + retry approach if we observe collisions.
appBootstrap, bootstrapPeerID, _, _ := setupNode(t, owner, bootstrapNodePortV1, bootstrapNodePortV2, fmt.Sprintf("b_%d", test.id), b, test.ns, nil)
appBootstrap, bootstrapPeerID, _, _ := setupNode(t, owner, bootstrapNodePortV1, bootstrapNodePortV2, b, test.ns, nil)
var (
oracles []confighelper.OracleIdentityExtra
transmitters []common.Address
Expand All @@ -878,7 +877,7 @@ func TestIntegration_OCR(t *testing.T) {
for i := 0; i < numOracles; i++ {
portV1 := ports[2*i]
portV2 := ports[2*i+1]
app, peerID, transmitter, key := setupNode(t, owner, portV1, portV2, fmt.Sprintf("o%d_%d", i, test.id), b, test.ns, func(c *chainlink.Config, s *chainlink.Secrets) {
app, peerID, transmitter, key := setupNode(t, owner, portV1, portV2, b, test.ns, func(c *chainlink.Config, s *chainlink.Secrets) {
c.EVM[0].FlagsContractAddress = ptr(ethkey.EIP55AddressFromAddress(flagsContractAddress))
c.EVM[0].GasEstimator.EIP1559DynamicFees = ptr(test.eip1559)
if test.ns != ocrnetworking.NetworkingStackV1 {
Expand Down Expand Up @@ -1092,7 +1091,7 @@ func TestIntegration_OCR_ForwarderFlow(t *testing.T) {

// Note it's plausible these ports could be occupied on a CI machine.
// May need a port randomize + retry approach if we observe collisions.
appBootstrap, bootstrapPeerID, _, _ := setupNode(t, owner, bootstrapNodePortV1, bootstrapNodePortV2, fmt.Sprintf("b_%d", 1), b, ocrnetworking.NetworkingStackV2, nil)
appBootstrap, bootstrapPeerID, _, _ := setupNode(t, owner, bootstrapNodePortV1, bootstrapNodePortV2, b, ocrnetworking.NetworkingStackV2, nil)

var (
oracles []confighelper.OracleIdentityExtra
Expand All @@ -1105,7 +1104,7 @@ func TestIntegration_OCR_ForwarderFlow(t *testing.T) {
for i := 0; i < numOracles; i++ {
portV1 := ports[2*i]
portV2 := ports[2*i+1]
app, peerID, transmitter, forwarder, key := setupForwarderEnabledNode(t, owner, portV1, portV2, fmt.Sprintf("o%d_%d", i, 1), b, ocrnetworking.NetworkingStackV2, func(c *chainlink.Config, s *chainlink.Secrets) {
app, peerID, transmitter, forwarder, key := setupForwarderEnabledNode(t, owner, portV1, portV2, b, ocrnetworking.NetworkingStackV2, func(c *chainlink.Config, s *chainlink.Secrets) {
c.Feature.LogPoller = ptr(true)
c.EVM[0].FlagsContractAddress = ptr(ethkey.EIP55AddressFromAddress(flagsContractAddress))
c.EVM[0].GasEstimator.EIP1559DynamicFees = ptr(true)
Expand Down
11 changes: 5 additions & 6 deletions core/internal/features/ocr2/features_ocr2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,12 @@ func setupNodeOCR2(
t *testing.T,
owner *bind.TransactOpts,
port int,
dbName string,
useForwarder bool,
b *backends.SimulatedBackend,
p2pV2Bootstrappers []commontypes.BootstrapperLocator,
) *ocr2Node {
p2pKey := keystest.NewP2PKeyV2(t)
config, _ := heavyweight.FullTestDBV2(t, fmt.Sprintf("%s%d", dbName, port), func(c *chainlink.Config, s *chainlink.Secrets) {
config, _ := heavyweight.FullTestDBV2(t, func(c *chainlink.Config, s *chainlink.Secrets) {
c.Insecure.OCRDevelopmentMode = ptr(true) // Disables ocr spec validation so we can have fast polling for the test.

c.Feature.LogPoller = ptr(true)
Expand Down Expand Up @@ -193,7 +192,7 @@ func TestIntegration_OCR2(t *testing.T) {

lggr := logger.TestLogger(t)
bootstrapNodePort := freeport.GetOne(t)
bootstrapNode := setupNodeOCR2(t, owner, bootstrapNodePort, "bootstrap", false /* useForwarders */, b, nil)
bootstrapNode := setupNodeOCR2(t, owner, bootstrapNodePort, false /* useForwarders */, b, nil)

var (
oracles []confighelper2.OracleIdentityExtra
Expand All @@ -203,7 +202,7 @@ func TestIntegration_OCR2(t *testing.T) {
)
ports := freeport.GetN(t, 4)
for i := 0; i < 4; i++ {
node := setupNodeOCR2(t, owner, ports[i], fmt.Sprintf("oracle%d", i), false /* useForwarders */, b, []commontypes.BootstrapperLocator{
node := setupNodeOCR2(t, owner, ports[i], false /* useForwarders */, b, []commontypes.BootstrapperLocator{
// Supply the bootstrap IP and port as a V2 peer address
{PeerID: bootstrapNode.peerID, Addrs: []string{fmt.Sprintf("127.0.0.1:%d", bootstrapNodePort)}},
})
Expand Down Expand Up @@ -477,7 +476,7 @@ func TestIntegration_OCR2_ForwarderFlow(t *testing.T) {

lggr := logger.TestLogger(t)
bootstrapNodePort := freeport.GetOne(t)
bootstrapNode := setupNodeOCR2(t, owner, bootstrapNodePort, "bootstrap", true /* useForwarders */, b, nil)
bootstrapNode := setupNodeOCR2(t, owner, bootstrapNodePort, true /* useForwarders */, b, nil)

var (
oracles []confighelper2.OracleIdentityExtra
Expand All @@ -488,7 +487,7 @@ func TestIntegration_OCR2_ForwarderFlow(t *testing.T) {
)
ports := freeport.GetN(t, 4)
for i := uint16(0); i < 4; i++ {
node := setupNodeOCR2(t, owner, ports[i], fmt.Sprintf("oracle%d", i), true /* useForwarders */, b, []commontypes.BootstrapperLocator{
node := setupNodeOCR2(t, owner, ports[i], true /* useForwarders */, b, []commontypes.BootstrapperLocator{
// Supply the bootstrap IP and port as a V2 peer address
{PeerID: bootstrapNode.peerID, Addrs: []string{fmt.Sprintf("127.0.0.1:%d", bootstrapNodePort)}},
})
Expand Down
18 changes: 3 additions & 15 deletions core/services/fluxmonitorv2/flux_monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package fluxmonitorv2_test
import (
"fmt"
"math/big"
"strings"
"testing"
"time"

Expand All @@ -26,7 +25,6 @@ import (
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/log"
logmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/log/mocks"
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr"
"github.com/smartcontractkit/chainlink/v2/core/cmd"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/flux_aggregator_wrapper"
"github.com/smartcontractkit/chainlink/v2/core/internal/cltest"
"github.com/smartcontractkit/chainlink/v2/core/internal/cltest/heavyweight"
Expand Down Expand Up @@ -284,8 +282,8 @@ func setupStoreWithKey(t *testing.T) (*sqlx.DB, common.Address) {
}

// setupStoreWithKey setups a new store and adds a key to the keystore
func setupFullDBWithKey(t *testing.T, name string) (*sqlx.DB, common.Address) {
cfg, db := heavyweight.FullTestDBV2(t, name, nil)
func setupFullDBWithKey(t *testing.T) (*sqlx.DB, common.Address) {
cfg, db := heavyweight.FullTestDBV2(t, nil)
ethKeyStore := cltest.NewKeyStore(t, db, cfg.Database()).Eth()
_, nodeAddr := cltest.MustInsertRandomKey(t, ethKeyStore)

Expand Down Expand Up @@ -906,18 +904,8 @@ func TestFluxMonitor_HibernationTickerFiresMultipleTimes(t *testing.T) {
g.Eventually(func() int { return len(pollOccured) }, testutils.WaitTimeout(t)).Should(gomega.Equal(3))
}

// chainlink_test_TestFluxMonitor_HibernationIsEnteredAndRetryTickerStopped
// 63 bytes is max and chainlink_test_ takes up 15, plus 4 for a random hex suffix.
func dbName(s string) string {
diff := len(cmd.TestDBNamePrefix) + len("_FFF")
if len(s) <= diff {
return strings.ReplaceAll(strings.ToLower(s), "/", "")
}
return strings.ReplaceAll(strings.ToLower(s[len(s)-diff:]), "/", "")
}

func TestFluxMonitor_HibernationIsEnteredAndRetryTickerStopped(t *testing.T) {
db, nodeAddr := setupFullDBWithKey(t, "hibernation")
db, nodeAddr := setupFullDBWithKey(t)
oracles := []common.Address{nodeAddr, testutils.NewAddress()}

const (
Expand Down
2 changes: 1 addition & 1 deletion core/services/fluxmonitorv2/integrations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func startApplication(
fa fluxAggregatorUniverse,
overrides func(c *chainlink.Config, s *chainlink.Secrets),
) *cltest.TestApplication {
config, _ := heavyweight.FullTestDBV2(t, dbName(t.Name()), overrides)
config, _ := heavyweight.FullTestDBV2(t, overrides)
app := cltest.NewApplicationWithConfigV2AndKeyOnSimulatedBlockchain(t, config, fa.backend, fa.key)
require.NoError(t, app.Start(testutils.Context(t)))
return app
Expand Down
6 changes: 3 additions & 3 deletions core/services/keeper/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func TestKeeperEthIntegration(t *testing.T) {
backend.Commit()

// setup app
config, db := heavyweight.FullTestDBV2(t, fmt.Sprintf("keeper_eth_integration_%s", test.name), func(c *chainlink.Config, s *chainlink.Secrets) {
config, db := heavyweight.FullTestDBV2(t, func(c *chainlink.Config, s *chainlink.Secrets) {
c.EVM[0].GasEstimator.EIP1559DynamicFees = &test.eip1559
c.Keeper.MaxGracePeriod = ptr[int64](0) // avoid waiting to re-submit for upkeeps
c.Keeper.Registry.SyncInterval = models.MustNewDuration(24 * time.Hour) // disable full sync ticker for test
Expand Down Expand Up @@ -393,7 +393,7 @@ func TestKeeperForwarderEthIntegration(t *testing.T) {
backend.Commit()

// setup app
config, db := heavyweight.FullTestDBV2(t, "keeper_forwarder_flow", func(c *chainlink.Config, s *chainlink.Secrets) {
config, db := heavyweight.FullTestDBV2(t, func(c *chainlink.Config, s *chainlink.Secrets) {
c.Feature.LogPoller = ptr(true)
c.EVM[0].GasEstimator.EIP1559DynamicFees = ptr(true)
c.Keeper.MaxGracePeriod = ptr[int64](0) // avoid waiting to re-submit for upkeeps
Expand Down Expand Up @@ -540,7 +540,7 @@ func TestMaxPerformDataSize(t *testing.T) {
backend.Commit()

// setup app
config, db := heavyweight.FullTestDBV2(t, "keeper_max_perform_data_test", func(c *chainlink.Config, s *chainlink.Secrets) {
config, db := heavyweight.FullTestDBV2(t, func(c *chainlink.Config, s *chainlink.Secrets) {
c.Keeper.MaxGracePeriod = ptr[int64](0) // avoid waiting to re-submit for upkeeps
c.Keeper.Registry.SyncInterval = models.MustNewDuration(24 * time.Hour) // disable full sync ticker for test
c.Keeper.Registry.MaxPerformDataSize = ptr(uint32(maxPerformDataSize)) // set the max perform data size
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,15 +302,14 @@ func StartNewNode(
t *testing.T,
owner *bind.TransactOpts,
port int,
dbName string,
b *backends.SimulatedBackend,
maxGas uint32,
p2pV2Bootstrappers []commontypes.BootstrapperLocator,
ocr2Keystore []byte,
thresholdKeyShare string,
) *Node {
p2pKey := keystest.NewP2PKeyV2(t)
config, _ := heavyweight.FullTestDBV2(t, fmt.Sprintf("%s%d", dbName, port), func(c *chainlink.Config, s *chainlink.Secrets) {
config, _ := heavyweight.FullTestDBV2(t, func(c *chainlink.Config, s *chainlink.Secrets) {
c.Insecure.OCRDevelopmentMode = ptr(true)

c.Feature.LogPoller = ptr(true)
Expand Down Expand Up @@ -550,7 +549,7 @@ func CreateFunctionsNodes(
}

bootstrapPort := freeport.GetOne(t)
bootstrapNode = StartNewNode(t, owner, bootstrapPort, "bootstrap", b, uint32(maxGas), nil, nil, "")
bootstrapNode = StartNewNode(t, owner, bootstrapPort, b, uint32(maxGas), nil, nil, "")
AddBootstrapJob(t, bootstrapNode.App, routerAddress)

// oracle nodes with jobs, bridges and mock EAs
Expand All @@ -568,7 +567,7 @@ func CreateFunctionsNodes(
} else {
ocr2Keystore = ocr2Keystores[i]
}
oracleNode := StartNewNode(t, owner, ports[i], fmt.Sprintf("oracle%d", i), b, uint32(maxGas), []commontypes.BootstrapperLocator{
oracleNode := StartNewNode(t, owner, ports[i], b, uint32(maxGas), []commontypes.BootstrapperLocator{
{PeerID: bootstrapNode.PeerID, Addrs: []string{fmt.Sprintf("127.0.0.1:%d", bootstrapPort)}},
}, ocr2Keystore, thresholdKeyShare)
oracleNodes = append(oracleNodes, oracleNode.App)
Expand Down
2 changes: 1 addition & 1 deletion core/services/ocr2/plugins/mercury/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func setupNode(

p2paddresses := []string{fmt.Sprintf("127.0.0.1:%d", port)}

config, _ := heavyweight.FullTestDBV2(t, fmt.Sprintf("%s%d", dbName, port), func(c *chainlink.Config, s *chainlink.Secrets) {
config, _ := heavyweight.FullTestDBV2(t, func(c *chainlink.Config, s *chainlink.Secrets) {
// [JobPipeline]
// MaxSuccessfulRuns = 0
c.JobPipeline.MaxSuccessfulRuns = ptr(uint64(0))
Expand Down
Loading

0 comments on commit 4ccd1c5

Please sign in to comment.