diff --git a/itests/clusterdb_test.go b/itests/clusterdb_test.go index 9a2ddb2e1..05846af72 100644 --- a/itests/clusterdb_test.go +++ b/itests/clusterdb_test.go @@ -9,7 +9,6 @@ import ( "github.com/filecoin-project/lotus/itests/kit" "github.com/filecoin-project/lotus/lib/sturdy/clusterdb" - "github.com/filecoin-project/lotus/node" "github.com/filecoin-project/lotus/node/impl" ) @@ -17,11 +16,6 @@ func withSetup(t *testing.T, f func(*kit.TestMiner)) { _, miner, _ := kit.EnsembleMinimal(t, kit.LatestActorsAt(-1), kit.MockProofs(), - kit.ConstructorOpts( - node.Override(new(clusterdb.ITestID), func() clusterdb.ITestID { - return clusterdb.ITestNewID() - }), - ), ) defer miner.BaseAPI.(*impl.StorageMinerAPI).ClusterDB.ITestDeleteAll() diff --git a/itests/kit/ensemble.go b/itests/kit/ensemble.go index 19cc163af..d00077274 100644 --- a/itests/kit/ensemble.go +++ b/itests/kit/ensemble.go @@ -49,6 +49,7 @@ import ( "github.com/filecoin-project/lotus/cmd/lotus-worker/sealworker" "github.com/filecoin-project/lotus/gateway" "github.com/filecoin-project/lotus/genesis" + "github.com/filecoin-project/lotus/lib/sturdy/clusterdb" "github.com/filecoin-project/lotus/markets/idxprov" "github.com/filecoin-project/lotus/markets/idxprov/idxprov_test" lotusminer "github.com/filecoin-project/lotus/miner" @@ -357,6 +358,8 @@ func (n *Ensemble) Start() *Ensemble { n.mn = mocknet.New() } + sharedITestID := clusterdb.ITestNewID() + // --------------------- // FULL NODES // --------------------- @@ -722,6 +725,8 @@ func (n *Ensemble) Start() *Ensemble { // upgrades node.Override(new(stmgr.UpgradeSchedule), n.options.upgradeSchedule), + + node.Override(new(clusterdb.ITestID), sharedITestID), } if m.options.subsystems.Has(SMarkets) { @@ -824,6 +829,8 @@ func (n *Ensemble) Start() *Ensemble { auth := http.Header(nil) + // FUTURE: Use m.MinerNode.(BaseAPI).(impl.StorageMinerAPI).ClusterDB to setup. + remote := paths.NewRemote(localStore, m.MinerNode, auth, 20, &paths.DefaultPartialFileHandler{}) store := m.options.workerStorageOpt(remote) @@ -853,6 +860,7 @@ func (n *Ensemble) Start() *Ensemble { require.NoError(n.t, err) n.active.workers = append(n.active.workers, m) + } // If we are here, we have processed all inactive workers and moved them