Skip to content

Commit 6b39000

Browse files
AlexHentschelzhangchiqing
authored andcommitted
moved lock manager right next to database for better visibility
1 parent e9ca42a commit 6b39000

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

integration/testnet/network.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,6 @@ func PrepareFlowNetwork(t *testing.T, networkConf NetworkConfig, chainID flow.Ch
671671
}
672672

673673
func (net *FlowNetwork) addConsensusFollower(t *testing.T, rootProtocolSnapshotPath string, followerConf ConsensusFollowerConfig, _ []ContainerConfig) {
674-
lockManager := storage.NewTestingLockManager()
675674
tmpdir := makeTempSubDir(t, net.baseTempdir, "flow-consensus-follower")
676675

677676
// create a directory for the follower database
@@ -698,6 +697,7 @@ func (net *FlowNetwork) addConsensusFollower(t *testing.T, rootProtocolSnapshotP
698697
WithValueLogMaxEntries(100000) // Default is 1000000
699698
badgerDB, err := badgerstorage.InitPublic(dbOpts)
700699
require.NoError(t, err)
700+
lockManager := storage.NewTestingLockManager()
701701

702702
bindAddr := gonet.JoinHostPort("localhost", testingdock.RandomPort(t))
703703
opts := append(

module/builder/consensus/builder_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ func (bs *BuilderSuite) chainSeal(incorporatedResult *flow.IncorporatedResult) {
178178
// For the verifiers to start checking a result R, they need a source of randomness for the block _incorporating_
179179
// result R. The result for block [A3] is incorporated in [parent], which does _not_ have a child yet.
180180
func (bs *BuilderSuite) SetupTest() {
181-
lockManager := storage.NewTestingLockManager()
182181
// set up no-op dependencies
183182
noopMetrics := metrics.NewNoopCollector()
184183
noopTracer := trace.NewNoopTracer()
@@ -249,6 +248,8 @@ func (bs *BuilderSuite) SetupTest() {
249248

250249
// set up temporary database for tests
251250
bs.db, bs.dir = unittest.TempBadgerDB(bs.T())
251+
lockManager := storage.NewTestingLockManager()
252+
252253
lctx := lockManager.NewContext()
253254
require.NoError(bs.T(), lctx.AcquireLock(storage.LockFinalizeBlock))
254255
defer lctx.Release()

0 commit comments

Comments
 (0)