Skip to content

Commit

Permalink
Merge pull request #46 from xpoft/ISSUE-45
Browse files Browse the repository at this point in the history
[ISSUE-45] fix waiting for async steps in parent step
  • Loading branch information
koodeex authored Nov 28, 2022
2 parents dea35d2 + 4e0f89a commit ff31572
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/framework/core/common/step_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ func (ctx *stepCtx) WithNewStep(stepName string, step func(ctx provider.StepCtx)
defer ctx.currentStep.WithChild(newCtx.CurrentStep())
defer func() {
r := recover()
newCtx.WG().Wait()
newCtx.CurrentStep().Finish()
if r != nil {
ctxName := newCtx.ExecutionContextName()
Expand All @@ -168,7 +169,6 @@ func (ctx *stepCtx) WithNewAsyncStep(stepName string, step func(ctx provider.Ste
wg = ctx.parentStep.WG()
}
wg.Add(1)
defer wg.Wait()

go func() {
defer wg.Done()
Expand Down
1 change: 1 addition & 0 deletions pkg/framework/core/common/steps.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ func (c *Common) WithNewStep(stepName string, step func(ctx provider.StepCtx), p
defer c.Step(stCtx.CurrentStep())
defer func() {
r := recover()
stCtx.WG().Wait()
stCtx.CurrentStep().Finish()
if r != nil {
ctxName := c.ExecutionContext().GetName()
Expand Down

0 comments on commit ff31572

Please sign in to comment.