Skip to content

Commit

Permalink
Set RunStatus to AbortedUser when test.abort() is called
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Mirić committed Dec 17, 2021
1 parent 27dd185 commit f273ce4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
"gopkg.in/guregu/null.v3"

"go.k6.io/k6/errext"
"go.k6.io/k6/js/common"
"go.k6.io/k6/lib"
"go.k6.io/k6/lib/metrics"
"go.k6.io/k6/output"
Expand Down Expand Up @@ -263,9 +264,12 @@ func (e *Engine) startBackgroundProcesses(
if err != nil ***REMOVED***
e.logger.WithError(err).Debug("run: execution scheduler returned an error")
var serr errext.Exception
if errors.As(err, &serr) ***REMOVED***
switch ***REMOVED***
case errors.As(err, &serr):
e.setRunStatus(lib.RunStatusAbortedScriptError)
***REMOVED*** else ***REMOVED***
case common.IsInterruptError(err):
e.setRunStatus(lib.RunStatusAbortedUser)
default:
e.setRunStatus(lib.RunStatusAbortedSystem)
***REMOVED***
***REMOVED*** else ***REMOVED***
Expand Down

0 comments on commit f273ce4

Please sign in to comment.