Skip to content

Commit 1ac4fb3

Browse files
Merge pull request #4121 from Monokaix/ut
fix flaky test
2 parents fc1a634 + b952f92 commit 1ac4fb3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/controllers/jobflow/jobflow_controller_action_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,9 @@ func TestGetAllJobStatusFunc(t *testing.T) {
602602
if got != nil {
603603
got.JobStatusList[0].RunningHistories[0].StartTimestamp = metav1.Time{}
604604
got.JobStatusList[1].RunningHistories[0].StartTimestamp = metav1.Time{}
605+
sort.Slice(got.JobStatusList, func(i, j int) bool {
606+
return got.JobStatusList[i].StartTimestamp.Before(&got.JobStatusList[j].StartTimestamp)
607+
})
605608
}
606609
if !equality.Semantic.DeepEqual(got, tt.want) {
607610
t.Errorf("getAllJobStatus() got = %v, want %v", got, tt.want)

0 commit comments

Comments
 (0)