Skip to content

Commit 3b21184

Browse files
af-mdmaxdml
authored andcommitted
fix: ensure results and errors channels are closed after workflow execution in tests
1 parent 09a949f commit 3b21184

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

dbos/workflows_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -930,15 +930,16 @@ func TestGoRunningStepsInsideGoRoutines(t *testing.T) {
930930
}
931931
return "", nil
932932
}
933-
close(results)
934-
close(errors)
935933

936934
RegisterWorkflow(dbosCtx, goWorkflow)
937935
handle, err := RunWorkflow(dbosCtx, goWorkflow, "test-input")
938936
require.NoError(t, err, "failed to run go workflow")
939937
_, err = handle.GetResult()
940-
require.NoError(t, err, "failed to get result from go workflow")
938+
939+
close(results)
940+
close(errors)
941941

942+
require.NoError(t, err, "failed to get result from go workflow")
942943
assert.Equal(t, numSteps, len(results), "expected %d results, got %d", numSteps, len(results))
943944
assert.Equal(t, 0, len(errors), "expected no errors, got %d", len(errors))
944945
})

0 commit comments

Comments
 (0)