Skip to content

Commit

Permalink
test(f3): make the f3-enabled test wait for at one lease to expire
Browse files Browse the repository at this point in the history
  • Loading branch information
Stebalien committed Oct 10, 2024
1 parent cbaadd3 commit 51c60e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion itests/f3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestF3_Enabled(t *testing.T) {
blocktime := 100 * time.Millisecond
e := setup(t, blocktime)

e.waitTillF3Instance(3, 25*time.Second)
e.waitTillF3Instance(modules.F3LeaseTerm+1, 40*time.Second)
}

// Test that checks that F3 can be rebootsrapped by changing the manifest
Expand Down
7 changes: 4 additions & 3 deletions node/modules/storageminer.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ import (
"github.com/filecoin-project/lotus/storage/wdpost"
)

// F3LeaseTerm The number of instances the miner will attempt to lease from nodes.
const F3LeaseTerm = 5

type UuidWrapper struct {
v1api.FullNode
}
Expand Down Expand Up @@ -546,8 +549,6 @@ func F3Participation(mctx helpers.MetricsCtx, lc fx.Lifecycle, node v1api.FullNo
// checkProgressInterval defines the duration between progress checks in normal operation mode.
// This interval is used when there are no errors in retrieving the current progress.
checkProgressInterval = 10 * time.Second
// leaseTerm The number of instances the miner will attempt to lease from nodes.
leaseTerm = 5
)

participator := newF3Participator(
Expand All @@ -560,7 +561,7 @@ func F3Participation(mctx helpers.MetricsCtx, lc fx.Lifecycle, node v1api.FullNo
},
checkProgressMaxAttempts,
checkProgressInterval,
leaseTerm,
F3LeaseTerm,
)

ctx, cancel := context.WithCancel(mctx)
Expand Down

0 comments on commit 51c60e1

Please sign in to comment.