Skip to content

Commit

Permalink
Test updated
Browse files Browse the repository at this point in the history
  • Loading branch information
avneet15 committed Dec 18, 2023
1 parent 7b0bf33 commit c97e1b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions pkg/controller/flinkapplication/flink_state_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,7 @@ 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 @@ -762,7 +762,8 @@ func TestSubmittingVertexFailsToStart(t *testing.T) {
assert.Equal(t, jobID, mockFlinkController.GetLatestJobID(ctx, application))
} else if statusUpdateCount == 2 {
application := object.(*v1beta1.FlinkApplication)
assert.Equal(t, "", mockFlinkController.GetLatestJobID(ctx, application))
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)
Expand Down Expand Up @@ -928,9 +929,11 @@ func TestSubmittingVertexStartTimeout(t *testing.T) {
assert.Equal(t, jobID, mockFlinkController.GetLatestJobID(ctx, application))
} else if statusUpdateCount == 2 {
application := object.(*v1beta1.FlinkApplication)
assert.Equal(t, "", mockFlinkController.GetLatestJobID(ctx, application))
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)
}
statusUpdateCount++
Expand Down

0 comments on commit c97e1b2

Please sign in to comment.