diff --git a/flyteplugins/go/tasks/plugins/array/core/state.go b/flyteplugins/go/tasks/plugins/array/core/state.go index 665eec309f..d714c3404d 100644 --- a/flyteplugins/go/tasks/plugins/array/core/state.go +++ b/flyteplugins/go/tasks/plugins/array/core/state.go @@ -273,7 +273,7 @@ func SummaryToPhase(ctx context.Context, minSuccesses int64, summary arraystatus logger.Infof(ctx, "Array is still running and waiting for resources totalWaitingForResources[%v]", totalWaitingForResources) return PhaseWaitingForResources } - if totalSuccesses >= minSuccesses && totalRunning == 0 { + if totalSuccesses >= minSuccesses && totalRunning == 0 && totalRetryableFailures == 0 { logger.Infof(ctx, "Array succeeded because totalSuccesses[%v] >= minSuccesses[%v]", totalSuccesses, minSuccesses) return PhaseWriteToDiscovery } diff --git a/flyteplugins/go/tasks/plugins/array/core/state_test.go b/flyteplugins/go/tasks/plugins/array/core/state_test.go index 26a80531b5..c81252bbf8 100644 --- a/flyteplugins/go/tasks/plugins/array/core/state_test.go +++ b/flyteplugins/go/tasks/plugins/array/core/state_test.go @@ -333,7 +333,7 @@ func TestSummaryToPhase(t *testing.T) { core.PhaseSuccess: 10, }, }, - { + { "FailedToRetry", PhaseWriteToDiscoveryThenFail, map[core.Phase]int64{ @@ -349,6 +349,15 @@ func TestSummaryToPhase(t *testing.T) { core.PhaseRetryableFailure: 5, }, }, + { + // complete retry even though minSuccesses is achieved + "RetryMinSuccessRatio", + PhaseCheckingSubTaskExecutions, + map[core.Phase]int64{ + core.PhaseSuccess: 10, + core.PhaseRetryableFailure: 1, + }, + }, } for _, tt := range tests {