Skip to content

Commit

Permalink
fix(test): fix TestWFDefaultWithWFTAndWf flakiness (argoproj#4538)
Browse files Browse the repository at this point in the history
Signed-off-by: Saravanan Balasubramanian <sarabala1979@gmail.com>
Signed-off-by: Alex Capras <alexcapras@gmail.com>
  • Loading branch information
sarabala1979 authored and alexcapras committed Dec 2, 2020
1 parent aa232fc commit 4d94e07
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions workflow/controller/operator_wfdefault_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,11 @@ func TestWFDefaultWithWFTAndWf(t *testing.T) {
var resultSpec wfv1.WorkflowSpec
err := json.Unmarshal([]byte(storedSpecResult), &resultSpec)
assert.NoError(err)
cancel, controller := newControllerWithDefaults()
defer cancel()
controller.Config.WorkflowDefaults = wfDefault
_, err = controller.wfclientset.ArgoprojV1alpha1().WorkflowTemplates("default").Create(wft)
assert.NoError(err)
t.Run("SubmitSimpleWorkflowRef", func(t *testing.T) {
cancel, controller := newController(wft)
defer cancel()
controller.Config.WorkflowDefaults = wfDefault

wf := wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Namespace: "default"}, Spec: wfv1.WorkflowSpec{WorkflowTemplateRef: &wfv1.WorkflowTemplateRef{Name: "workflow-template-submittable"}}}
woc := newWorkflowOperationCtx(&wf, controller)
woc.operate()
Expand All @@ -237,6 +236,10 @@ func TestWFDefaultWithWFTAndWf(t *testing.T) {
})

t.Run("SubmitComplexWorkflowRef", func(t *testing.T) {
cancel, controller := newController(wft)
defer cancel()
controller.Config.WorkflowDefaults = wfDefault

ttlStrategy := wfv1.TTLStrategy{
SecondsAfterCompletion: pointer.Int32Ptr(10),
}
Expand All @@ -259,6 +262,10 @@ func TestWFDefaultWithWFTAndWf(t *testing.T) {
})

t.Run("SubmitComplexWorkflowRefWithArguments", func(t *testing.T) {
cancel, controller := newController(wft)
defer cancel()
controller.Config.WorkflowDefaults = wfDefault

param := wfv1.Parameter{
Name: "Test",
Value: wfv1.AnyStringPtr("welcome"),
Expand Down

0 comments on commit 4d94e07

Please sign in to comment.