Clusterdb ITests: default to unique test id
This commit is contained in:
parent
c89e9ca44f
commit
76489c2e04
@ -9,7 +9,6 @@ import (
|
|||||||
|
|
||||||
"github.com/filecoin-project/lotus/itests/kit"
|
"github.com/filecoin-project/lotus/itests/kit"
|
||||||
"github.com/filecoin-project/lotus/lib/sturdy/clusterdb"
|
"github.com/filecoin-project/lotus/lib/sturdy/clusterdb"
|
||||||
"github.com/filecoin-project/lotus/node"
|
|
||||||
"github.com/filecoin-project/lotus/node/impl"
|
"github.com/filecoin-project/lotus/node/impl"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -17,11 +16,6 @@ func withSetup(t *testing.T, f func(*kit.TestMiner)) {
|
|||||||
_, miner, _ := kit.EnsembleMinimal(t,
|
_, miner, _ := kit.EnsembleMinimal(t,
|
||||||
kit.LatestActorsAt(-1),
|
kit.LatestActorsAt(-1),
|
||||||
kit.MockProofs(),
|
kit.MockProofs(),
|
||||||
kit.ConstructorOpts(
|
|
||||||
node.Override(new(clusterdb.ITestID), func() clusterdb.ITestID {
|
|
||||||
return clusterdb.ITestNewID()
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
defer miner.BaseAPI.(*impl.StorageMinerAPI).ClusterDB.ITestDeleteAll()
|
defer miner.BaseAPI.(*impl.StorageMinerAPI).ClusterDB.ITestDeleteAll()
|
||||||
|
@ -49,6 +49,7 @@ import (
|
|||||||
"github.com/filecoin-project/lotus/cmd/lotus-worker/sealworker"
|
"github.com/filecoin-project/lotus/cmd/lotus-worker/sealworker"
|
||||||
"github.com/filecoin-project/lotus/gateway"
|
"github.com/filecoin-project/lotus/gateway"
|
||||||
"github.com/filecoin-project/lotus/genesis"
|
"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"
|
||||||
"github.com/filecoin-project/lotus/markets/idxprov/idxprov_test"
|
"github.com/filecoin-project/lotus/markets/idxprov/idxprov_test"
|
||||||
lotusminer "github.com/filecoin-project/lotus/miner"
|
lotusminer "github.com/filecoin-project/lotus/miner"
|
||||||
@ -357,6 +358,8 @@ func (n *Ensemble) Start() *Ensemble {
|
|||||||
n.mn = mocknet.New()
|
n.mn = mocknet.New()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sharedITestID := clusterdb.ITestNewID()
|
||||||
|
|
||||||
// ---------------------
|
// ---------------------
|
||||||
// FULL NODES
|
// FULL NODES
|
||||||
// ---------------------
|
// ---------------------
|
||||||
@ -722,6 +725,8 @@ func (n *Ensemble) Start() *Ensemble {
|
|||||||
|
|
||||||
// upgrades
|
// upgrades
|
||||||
node.Override(new(stmgr.UpgradeSchedule), n.options.upgradeSchedule),
|
node.Override(new(stmgr.UpgradeSchedule), n.options.upgradeSchedule),
|
||||||
|
|
||||||
|
node.Override(new(clusterdb.ITestID), sharedITestID),
|
||||||
}
|
}
|
||||||
|
|
||||||
if m.options.subsystems.Has(SMarkets) {
|
if m.options.subsystems.Has(SMarkets) {
|
||||||
@ -824,6 +829,8 @@ func (n *Ensemble) Start() *Ensemble {
|
|||||||
|
|
||||||
auth := http.Header(nil)
|
auth := http.Header(nil)
|
||||||
|
|
||||||
|
// FUTURE: Use m.MinerNode.(BaseAPI).(impl.StorageMinerAPI).ClusterDB to setup.
|
||||||
|
|
||||||
remote := paths.NewRemote(localStore, m.MinerNode, auth, 20, &paths.DefaultPartialFileHandler{})
|
remote := paths.NewRemote(localStore, m.MinerNode, auth, 20, &paths.DefaultPartialFileHandler{})
|
||||||
store := m.options.workerStorageOpt(remote)
|
store := m.options.workerStorageOpt(remote)
|
||||||
|
|
||||||
@ -853,6 +860,7 @@ func (n *Ensemble) Start() *Ensemble {
|
|||||||
require.NoError(n.t, err)
|
require.NoError(n.t, err)
|
||||||
|
|
||||||
n.active.workers = append(n.active.workers, m)
|
n.active.workers = append(n.active.workers, m)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we are here, we have processed all inactive workers and moved them
|
// If we are here, we have processed all inactive workers and moved them
|
||||||
|
Loading…
Reference in New Issue
Block a user