Skip to content

Commit

Permalink
Get the workflow and increase the timeout of this test
Browse files Browse the repository at this point in the history
  • Loading branch information
jmigueprieto committed Nov 27, 2024
1 parent a7cb272 commit 837b0ea
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions test/integration_tests/workflow_definition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
const retryLimit = 5

func TestWorkflowCreation(t *testing.T) {
executor := testdata.WorkflowExecutor
workflow := testdata.NewKitchenSinkWorkflow(testdata.WorkflowExecutor)
err := workflow.Register(true)
if err != nil {
Expand All @@ -31,9 +32,25 @@ func TestWorkflowCreation(t *testing.T) {
if err != nil {
t.Fatalf("Failed to complete the workflow, reason: %s", err)
}

assert.NotEmpty(t, run, "Workflow is null", run)
assert.Equal(t, string(model.CompletedWorkflow), run.Status)
assert.Equal(t, "input1", run.Input["key1"])

timeout := time.After(60 * time.Second)
tick := time.Tick(1 * time.Second)
workflowId := run.WorkflowId
for {
select {
case <-timeout:
t.Fatalf("Timed out and workflow %s didn't complete", workflowId)
case <-tick:
wf, err := executor.GetWorkflow(workflowId, false)
assert.NoError(t, err)
assert.Equal(t, model.CompletedWorkflow, wf.Status)
assert.Equal(t, "input1", run.Input["key1"])
return
}
}

}

func TestRemoveWorkflow(t *testing.T) {
Expand Down

0 comments on commit 837b0ea

Please sign in to comment.