diff --git a/lotus-soup/common_roles.go b/lotus-soup/common_roles.go index 9d5c1d1b7..27017bf8a 100644 --- a/lotus-soup/common_roles.go +++ b/lotus-soup/common_roles.go @@ -3,7 +3,6 @@ package main import ( "context" "fmt" - "math/rand" "time" "github.com/filecoin-project/lotus/build" @@ -54,15 +53,15 @@ func runMiner(t *TestEnvironment) error { stateMineNext := sync.State(fmt.Sprintf("mine-block-%d", i)) t.SyncClient.MustSignalAndWait(ctx, stateMineNext, miners) - // add some random delay to encourage a different miner winning each round - time.Sleep(time.Duration(100 + rand.Intn(int(100*time.Millisecond)))) - + ch := make(chan struct{}) err := miner.MineOne(ctx, func(mined bool) { t.D().Counter(fmt.Sprintf("block.mine,miner=%s", myActorAddr)).Inc(1) + close(ch) }) if err != nil { panic(err) } + <-ch } // signal the last block to make sure no miners are left stuck waiting for the next block signal @@ -81,6 +80,8 @@ func runMiner(t *TestEnvironment) error { t.RecordMessage("shutting down mining") <-done + time.Sleep(3600 * time.Second) + t.SyncClient.MustSignalAndWait(ctx, stateDone, t.TestInstanceCount) return nil } diff --git a/lotus-soup/compositions/composition-k8s-10-3.toml b/lotus-soup/compositions/composition-k8s-10-3.toml index 7110e8114..91b0276d7 100644 --- a/lotus-soup/compositions/composition-k8s-10-3.toml +++ b/lotus-soup/compositions/composition-k8s-10-3.toml @@ -20,7 +20,7 @@ miners = "3" genesis_timestamp_offset = "100000" balance = "2000" - sectors = "10" + sectors = "20" [[groups]] id = "bootstrapper"