don't defer in a loop
This commit is contained in:
parent
fa09b9afb1
commit
b115e2879a
@ -6,15 +6,16 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
logging "github.com/ipfs/go-log/v2"
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-address"
|
"github.com/filecoin-project/go-address"
|
||||||
"github.com/filecoin-project/go-state-types/abi"
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
"github.com/filecoin-project/go-state-types/network"
|
"github.com/filecoin-project/go-state-types/network"
|
||||||
"github.com/filecoin-project/lotus/api"
|
"github.com/filecoin-project/lotus/api"
|
||||||
"github.com/filecoin-project/lotus/chain/types"
|
"github.com/filecoin-project/lotus/chain/types"
|
||||||
"github.com/filecoin-project/lotus/itests/kit"
|
"github.com/filecoin-project/lotus/itests/kit"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
"github.com/stretchr/testify/require"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCCUpgrade(t *testing.T) {
|
func TestCCUpgrade(t *testing.T) {
|
||||||
@ -124,6 +125,7 @@ func waitForSectorStartUpgrade(ctx context.Context, t *testing.T, sn abi.SectorN
|
|||||||
|
|
||||||
func TestCCUpgradeAndPoSt(t *testing.T) {
|
func TestCCUpgradeAndPoSt(t *testing.T) {
|
||||||
kit.QuietMiningLogs()
|
kit.QuietMiningLogs()
|
||||||
|
_ = logging.SetLogLevel("storageminer", "INFO")
|
||||||
t.Run("upgrade and then post", func(t *testing.T) {
|
t.Run("upgrade and then post", func(t *testing.T) {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
n := runTestCCUpgrade(t, 100)
|
n := runTestCCUpgrade(t, 100)
|
||||||
|
@ -561,6 +561,12 @@ func (s *WindowPoStScheduler) runPoStCycle(ctx context.Context, di dline.Info, t
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defer func() {
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
log.Errorf("recover: %s", r)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
// Generate proofs in batches
|
// Generate proofs in batches
|
||||||
posts := make([]miner.SubmitWindowedPoStParams, 0, len(partitionBatches))
|
posts := make([]miner.SubmitWindowedPoStParams, 0, len(partitionBatches))
|
||||||
for batchIdx, batch := range partitionBatches {
|
for batchIdx, batch := range partitionBatches {
|
||||||
@ -651,11 +657,6 @@ func (s *WindowPoStScheduler) runPoStCycle(ctx context.Context, di dline.Info, t
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
defer func() {
|
|
||||||
if r := recover(); r != nil {
|
|
||||||
log.Errorf("recover: %s", r)
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
postOut, ps, err := s.prover.GenerateWindowPoSt(ctx, abi.ActorID(mid), xsinfos, append(abi.PoStRandomness{}, rand...))
|
postOut, ps, err := s.prover.GenerateWindowPoSt(ctx, abi.ActorID(mid), xsinfos, append(abi.PoStRandomness{}, rand...))
|
||||||
elapsed := time.Since(tsStart)
|
elapsed := time.Since(tsStart)
|
||||||
log.Infow("computing window post", "batch", batchIdx, "elapsed", elapsed)
|
log.Infow("computing window post", "batch", batchIdx, "elapsed", elapsed)
|
||||||
|
Loading…
Reference in New Issue
Block a user