File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -145,13 +145,18 @@ func (ss *stepState) Run(ctx xcontext.Context) error {
145145
146146 go func () {
147147 defer func () {
148+ // There could be a race condition when due to error in step runner, TestRunner gets the error earlier
149+ // than it is propagated here and cancels stepCtx
150+ if runErr := ss .stepRunner .getErr (); runErr != nil {
151+ ss .SetError (ctx , runErr )
152+ }
148153 close (ss .stopped )
149154 stepCtx .Debugf ("StepRunner fully stopped" )
150155 }()
151156
152157 select {
153158 case stepErr := <- stepRunResult .NotifyCh ():
154- ss .SetError (stepCtx , stepErr )
159+ ss .SetError (ctx , stepErr )
155160 case <- stepCtx .Done ():
156161 stepCtx .Debugf ("Cancelled step context during waiting for step run result" )
157162 }
You can’t perform that action at this time.
0 commit comments