From b899f9ea3c2cbf0c047fa0526ff395e74195ab3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Miri=C4=87?= Date: Tue, 13 Jul 2021 12:54:11 +0200 Subject: [PATCH] Update error message and docs --- core/local/local.go | 2 +- js/common/interrupt_error.go | 4 ++-- lib/executor/helpers.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/local/local.go b/core/local/local.go index 479d88bb6709..5e3b70fa633b 100644 --- a/core/local/local.go +++ b/core/local/local.go @@ -386,7 +386,7 @@ func (e *ExecutionScheduler) Run(globalCtx, runCtx context.Context, engineOut ch // We are using this context to allow lib.Executor implementations to cancel // this context effectively stopping all executions. // - // This is for addressing abortTest() + // This is for addressing test.abort(). execCtx := executor.Context(runSubCtx) for _, exec := range e.executors { go e.runExecutor(execCtx, runResults, engineOut, exec) diff --git a/js/common/interrupt_error.go b/js/common/interrupt_error.go index ce2476a560fe..c568e131ada3 100644 --- a/js/common/interrupt_error.go +++ b/js/common/interrupt_error.go @@ -31,8 +31,8 @@ func (i *InterruptError) Error() string { return i.Reason } -// AbortTest is a reason emitted when a test script calls abortTest() without arguments -const AbortTest = "abortTest() was called in a script" +// AbortTest is the reason emitted when a test script calls test.abort() +const AbortTest = "test aborted" // IsInterruptError returns true if err is *InterruptError. func IsInterruptError(err error) bool { diff --git a/lib/executor/helpers.go b/lib/executor/helpers.go index 0cc962dd72fc..37e789864464 100644 --- a/lib/executor/helpers.go +++ b/lib/executor/helpers.go @@ -92,7 +92,7 @@ type cancelExec struct { // executors. // // This allows executors to globally halt any executions that uses this context. -// Example use case is when a script calls abortTest() +// Example use case is when a script calls test.abort(). func Context(ctx context.Context) context.Context { ctx, cancel := context.WithCancel(ctx) return context.WithValue(ctx, cancelKey{}, &cancelExec{cancel: cancel})