This commit is contained in:
Łukasz Magiera 2023-03-06 14:46:26 +01:00
parent 9a295e58b0
commit b0ebdb6882
2 changed files with 4 additions and 12 deletions

View File

@ -399,7 +399,7 @@ func TestWindowPostWorkerDisconnected(t *testing.T) {
sectors := 2 * 48 * 2 sectors := 2 * 48 * 2
client, miner, badWorker, ens := kit.EnsembleWorker(t, _, miner, badWorker, ens := kit.EnsembleWorker(t,
kit.PresealSectors(sectors), // 2 sectors per partition, 2 partitions in all 48 deadlines kit.PresealSectors(sectors), // 2 sectors per partition, 2 partitions in all 48 deadlines
kit.LatestActorsAt(-1), kit.LatestActorsAt(-1),
kit.ThroughRPC(), kit.ThroughRPC(),
@ -408,14 +408,6 @@ func TestWindowPostWorkerDisconnected(t *testing.T) {
var goodWorker kit.TestWorker var goodWorker kit.TestWorker
ens.Worker(miner, &goodWorker, kit.WithTaskTypes([]sealtasks.TaskType{sealtasks.TTGenerateWindowPoSt}), kit.ThroughRPC()).Start() ens.Worker(miner, &goodWorker, kit.WithTaskTypes([]sealtasks.TaskType{sealtasks.TTGenerateWindowPoSt}), kit.ThroughRPC()).Start()
maddr, err := miner.ActorAddress(ctx)
require.NoError(t, err)
di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
require.NoError(t, err)
di = di.NextNotElapsed()
tryDl := func(dl uint64) { tryDl := func(dl uint64) {
p, err := miner.ComputeWindowPoSt(ctx, dl, types.EmptyTSK) p, err := miner.ComputeWindowPoSt(ctx, dl, types.EmptyTSK)
require.NoError(t, err) require.NoError(t, err)
@ -424,7 +416,7 @@ func TestWindowPostWorkerDisconnected(t *testing.T) {
} }
tryDl(0) // this will run on the not-yet-bad badWorker tryDl(0) // this will run on the not-yet-bad badWorker
err = badWorker.Stop(ctx) err := badWorker.Stop(ctx)
require.NoError(t, err) require.NoError(t, err)
tryDl(10) // will fail on the badWorker, then should retry on the goodWorker tryDl(10) // will fail on the badWorker, then should retry on the goodWorker

View File

@ -3,14 +3,14 @@ package sealer
import ( import (
"context" "context"
"errors" "errors"
"github.com/filecoin-project/go-jsonrpc"
"github.com/hashicorp/go-multierror"
"math/rand" "math/rand"
"sync" "sync"
"time" "time"
"github.com/hashicorp/go-multierror"
"golang.org/x/xerrors" "golang.org/x/xerrors"
"github.com/filecoin-project/go-jsonrpc"
"github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/storage/paths" "github.com/filecoin-project/lotus/storage/paths"