Skip to content

Commit

Permalink
test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
avneet15 committed Dec 18, 2023
1 parent c97e1b2 commit 614068a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion pkg/controller/flinkapplication/flink_state_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,6 @@ func (s *FlinkStateMachine) handleSubmittingJob(ctx context.Context, app *v1beta
s.flinkController.LogEvent(ctx, app, corev1.EventTypeWarning, "JobMonitoringFailed", err.Error())
s.updateApplicationPhase(app, v1beta1.FlinkApplicationRollingBackJob)
return statusChanged, err
//return statusUnchanged, err
}
if jobStarted {
return updateJobAndReturn(ctx, s, app, hash)
Expand Down
7 changes: 5 additions & 2 deletions pkg/controller/flinkapplication/flink_state_machine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -760,13 +760,15 @@ func TestSubmittingVertexFailsToStart(t *testing.T) {
if statusUpdateCount == 1 {
application := object.(*v1beta1.FlinkApplication)
assert.Equal(t, jobID, mockFlinkController.GetLatestJobID(ctx, application))
assert.Equal(t, v1beta1.FlinkApplicationRollingBackJob, application.Status.Phase)
} else if statusUpdateCount == 2 {
application := object.(*v1beta1.FlinkApplication)
assert.Equal(t, jobID, mockFlinkController.GetLatestJobID(ctx, application))
assert.Equal(t, v1beta1.FlinkApplicationDeployFailed, application.Status.Phase)
} else if statusUpdateCount == 3 {
application := object.(*v1beta1.FlinkApplication)
assert.Equal(t, v1beta1.FlinkApplicationRollingBackJob, application.Status.Phase)
assert.Equal(t, v1beta1.FlinkApplicationDeployFailed, application.Status.Phase)
assert.Equal(t, jobID, mockFlinkController.GetLatestJobID(ctx, application))
}
statusUpdateCount++
return nil
Expand Down Expand Up @@ -927,14 +929,15 @@ func TestSubmittingVertexStartTimeout(t *testing.T) {
if statusUpdateCount == 1 {
application := object.(*v1beta1.FlinkApplication)
assert.Equal(t, jobID, mockFlinkController.GetLatestJobID(ctx, application))
assert.Equal(t, v1beta1.FlinkApplicationRollingBackJob, application.Status.Phase)
} else if statusUpdateCount == 2 {
application := object.(*v1beta1.FlinkApplication)
assert.Equal(t, jobID, mockFlinkController.GetLatestJobID(ctx, application))
assert.Equal(t, v1beta1.FlinkApplicationDeployFailed, application.Status.Phase)
} else if statusUpdateCount == 3 {
application := object.(*v1beta1.FlinkApplication)
assert.Equal(t, "", mockFlinkController.GetLatestJobID(ctx, application))
assert.Equal(t, v1beta1.FlinkApplicationRollingBackJob, application.Status.Phase)
assert.Equal(t, v1beta1.FlinkApplicationDeployFailed, application.Status.Phase)
}
statusUpdateCount++
return nil
Expand Down

0 comments on commit 614068a

Please sign in to comment.