From 85ff87c5f5d619ddb7b1e01c2c10ee5c7373d161 Mon Sep 17 00:00:00 2001 From: Mihail Stoykov Date: Fri, 13 Jan 2023 13:15:29 +0200 Subject: [PATCH] Add test for #2849 --- cmd/integration_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/cmd/integration_test.go b/cmd/integration_test.go index 901273b4a5b..8ffc0ddf69a 100644 --- a/cmd/integration_test.go +++ b/cmd/integration_test.go @@ -1004,6 +1004,30 @@ func TestAbortedByScriptAbortInVUCode(t *testing.T) { }) } +func TestAbortedByScriptAbortInVUCodeInGroup(t *testing.T) { + t.Parallel() + script := ` + import exec from 'k6/execution'; + import { group } from 'k6'; + export default function () { + group("here", () => { + exec.test.abort('foo'); + }); + }; + export function handleSummary() { return {stdout: '\n\n\nbogus summary\n\n\n'};} + ` + + t.Run("noLinger", func(t *testing.T) { + t.Parallel() + testAbortedByScriptTestAbort(t, true, script, runTestWithNoLinger) + }) + + t.Run("withLinger", func(t *testing.T) { + t.Parallel() + testAbortedByScriptTestAbort(t, true, script, runTestWithLinger) + }) +} + func TestAbortedByScriptAbortInSetup(t *testing.T) { t.Parallel() script := `