Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions internal/planner/planner.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,9 @@ func buildPlannedTask(planID, taskType string, planIndex int, params any) (seiv1
}

// taskMaxRetries is the executor's retry budget per task type. Default 0
// makes the first ExecutionFailed terminal. Wall-clock per N retries:
// 5s + 10s + 20s + 30s*(N-3) for N>=3.
// makes the first ExecutionFailed terminal. Wall-clock per N retries
// (RetryCount is incremented before retryBackoff is called):
// 10s for N=1; 10s + 20s + 30s*(N-2) for N>=2.
func taskMaxRetries(taskType string) int {
switch taskType {
case TaskConfigureGenesis:
Expand Down
18 changes: 18 additions & 0 deletions internal/planner/planner_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package planner

import "testing"

func TestTaskMaxRetries(t *testing.T) {
cases := map[string]int{
TaskConfigureGenesis: genesisConfigureMaxRetries,
TaskAssembleGenesis: groupAssemblyMaxRetries,
TaskDiscoverPeers: discoverPeersMaxRetries,
"unknown-task-type": 0,
"": 0,
}
for taskType, want := range cases {
if got := taskMaxRetries(taskType); got != want {
t.Errorf("taskMaxRetries(%q) = %d, want %d", taskType, got, want)
}
}
}
Loading