-
Notifications
You must be signed in to change notification settings - Fork 287
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Expected Behavior
If a child workflow is started and terminates during the test no go routine should be left once the test completes.
Actual Behavior
A go routine is left running from executeChildWorkflowWithDelay which doesn't seem to terminate.
Steps to Reproduce the Problem
- Create a test that runs a Workflow that starts a ChildWorkflow.
- Use
defer goleak.VerifyNone(s.T())
I've added a repo to illustrate how to reproduce the issue, see the file do_test.go:
type TestSuite struct {
suite.Suite
testsuite.WorkflowTestSuite
}
func Test(t *testing.T) {
suite.Run(t, new(TestSuite))
}
func ChildWorkflow(ctx workflow.Context) error {
return workflow.Sleep(ctx, 24*time.Hour)
}
func ParentWorkflow(ctx workflow.Context) error {
return workflow.ExecuteChildWorkflow(ctx, "ChildWorkflow", nil).Get(ctx, nil)
}
func (s *TestSuite) TestChildWorkflow() {
defer goleak.VerifyNone(s.T())
env := s.NewTestWorkflowEnvironment()
env.RegisterWorkflow(ChildWorkflow)
env.RegisterWorkflow(ParentWorkflow)
env.ExecuteWorkflow(ParentWorkflow)
err := env.GetWorkflowError()
s.Require().NoError(err)
env.AssertExpectations(s.T())
}Specifications
- Version:
v1.37.0 - Platform: -
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working