diff --git a/flyteplugins/go/tasks/plugins/array/core/state.go b/flyteplugins/go/tasks/plugins/array/core/state.go index d714c3404d..2c8252cbdf 100644 --- a/flyteplugins/go/tasks/plugins/array/core/state.go +++ b/flyteplugins/go/tasks/plugins/array/core/state.go @@ -273,7 +273,8 @@ 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 && totalRetryableFailures == 0 { + //if totalSuccesses >= minSuccesses && totalRunning == 0 && totalRetryableFailures == 0 { + if totalSuccesses >= minSuccesses && totalSuccesses+totalPermanentFailures == totalCount { 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 c81252bbf8..01b5b41528 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{ @@ -358,6 +358,15 @@ func TestSummaryToPhase(t *testing.T) { core.PhaseRetryableFailure: 1, }, }, + { + // ensure all tasks are executed even if minSuccesses is achieved + "ExecuteAllMinSuccessRatio", + PhaseCheckingSubTaskExecutions, + map[core.Phase]int64{ + core.PhaseSuccess: 10, + core.PhaseUndefined: 1, + }, + }, } for _, tt := range tests {