[go] cmd/internal/script: make TestInterruptCmd pass on plan9

1 view
Skip to first unread message

Alex Brainman (Gerrit)

unread,
Jul 16, 2026, 10:48:35 PM (yesterday) Jul 16
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Alex Brainman has uploaded the change for review

Commit message

cmd/internal/script: make TestInterruptCmd pass on plan9

This CL should have been part of CL 796480, but was mistakenly omitted.

Updates #77485.
Change-Id: Ib18dbbcd01ad2080d14c64494e2c71421a1bd2f5

Change diff

diff --git a/src/cmd/internal/script/engine_test.go b/src/cmd/internal/script/engine_test.go
index 19d1836..479fa71 100644
--- a/src/cmd/internal/script/engine_test.go
+++ b/src/cmd/internal/script/engine_test.go
@@ -13,6 +13,7 @@
"os/exec"
"runtime"
"slices"
+ "strings"
"testing"
"time"
)
@@ -59,13 +60,7 @@
if err == nil {
t.Fatal("expected Wait failure")
} else if err, ok := err.(*exec.ExitError); ok {
- expectedError := "signal: interrupt"
- if runtime.GOOS == "windows" {
- expectedError = "exit status 1"
- }
- if err.Error() != expectedError {
- t.Fatalf("unexpected error while exiting executable: got=%q, want=%q", err.Error(), expectedError)
- }
+ checkInterruptCmdError(t, err)
} else {
t.Fatalf("unexpected error while running executable: %s\n%s", err, string(buf))
}
@@ -76,6 +71,30 @@
}
}

+// checkInterruptCmdError calls t.Fatal if err is interrupt cmd error.
+func checkInterruptCmdError(t *testing.T, err error) {
+ errstr := err.Error()
+ if runtime.GOOS == "plan9" {
+ expectedPrefixError := "exit status: "
+ if !strings.HasPrefix(errstr, expectedPrefixError) {
+ t.Fatalf("unexpected error prefix while exiting executable: got=%q, want=%q", errstr, expectedPrefixError)
+ }
+ expectedSuffixError := ": interrupt"
+ if !strings.HasSuffix(errstr, expectedSuffixError) {
+ t.Fatalf("unexpected error suffix while exiting executable: got=%q, want=%q", errstr, expectedSuffixError)
+ }
+ return
+ }
+
+ expectedError := "signal: interrupt"
+ if runtime.GOOS == "windows" {
+ expectedError = "exit status 1"
+ }
+ if errstr != expectedError {
+ t.Fatalf("unexpected error while exiting executable: got=%q, want=%q", errstr, expectedError)
+ }
+}
+
func FuzzQuoteArgs(f *testing.F) {
state, err := NewState(context.Background(), f.TempDir(), nil /* env */)
if err != nil {

Change information

Files:
  • M src/cmd/internal/script/engine_test.go
Change size: S
Delta: 1 file changed, 26 insertions(+), 7 deletions(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ib18dbbcd01ad2080d14c64494e2c71421a1bd2f5
Gerrit-Change-Number: 801960
Gerrit-PatchSet: 1
Gerrit-Owner: Alex Brainman <alex.b...@gmail.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Alex Brainman (Gerrit)

unread,
Jul 16, 2026, 10:51:40 PM (yesterday) Jul 16
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Alex Brainman voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ib18dbbcd01ad2080d14c64494e2c71421a1bd2f5
Gerrit-Change-Number: 801960
Gerrit-PatchSet: 1
Gerrit-Owner: Alex Brainman <alex.b...@gmail.com>
Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
Gerrit-Comment-Date: Fri, 17 Jul 2026 02:51:31 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Alex Brainman (Gerrit)

unread,
2:40 AM (21 hours ago) 2:40 AM
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
Attention needed from Alex Brainman

Alex Brainman uploaded new patchset

Alex Brainman uploaded patch set #2 to this change.
Following approvals got outdated and were removed:
Open in Gerrit

Related details

Attention is currently required from:
  • Alex Brainman
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ib18dbbcd01ad2080d14c64494e2c71421a1bd2f5
Gerrit-Change-Number: 801960
Gerrit-PatchSet: 2
Gerrit-Owner: Alex Brainman <alex.b...@gmail.com>
Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
Gerrit-CC: David du Colombier <0in...@gmail.com>
Gerrit-CC: Richard Miller <millerr...@gmail.com>
Gerrit-Attention: Alex Brainman <alex.b...@gmail.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Alex Brainman (Gerrit)

unread,
2:42 AM (21 hours ago) 2:42 AM
to goph...@pubsubhelper.golang.org, golang...@luci-project-accounts.iam.gserviceaccount.com, David du Colombier, Richard Miller, golang-co...@googlegroups.com

Alex Brainman voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ib18dbbcd01ad2080d14c64494e2c71421a1bd2f5
Gerrit-Change-Number: 801960
Gerrit-PatchSet: 2
Gerrit-Owner: Alex Brainman <alex.b...@gmail.com>
Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
Gerrit-CC: David du Colombier <0in...@gmail.com>
Gerrit-CC: Richard Miller <millerr...@gmail.com>
Gerrit-Comment-Date: Fri, 17 Jul 2026 06:42:02 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Richard Miller (Gerrit)

unread,
7:31 AM (16 hours ago) 7:31 AM
to Alex Brainman, goph...@pubsubhelper.golang.org, golang...@luci-project-accounts.iam.gserviceaccount.com, David du Colombier, golang-co...@googlegroups.com
Attention needed from Alex Brainman

Richard Miller voted Code-Review+2

Code-Review+2
Open in Gerrit

Related details

Attention is currently required from:
  • Alex Brainman
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ib18dbbcd01ad2080d14c64494e2c71421a1bd2f5
Gerrit-Change-Number: 801960
Gerrit-PatchSet: 2
Gerrit-Owner: Alex Brainman <alex.b...@gmail.com>
Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
Gerrit-Reviewer: Richard Miller <millerr...@gmail.com>
Gerrit-Attention: Alex Brainman <alex.b...@gmail.com>
Gerrit-Comment-Date: Fri, 17 Jul 2026 11:30:52 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Michael Pratt (Gerrit)

unread,
3:08 PM (8 hours ago) 3:08 PM
to Alex Brainman, goph...@pubsubhelper.golang.org, Michael Pratt, Richard Miller, golang...@luci-project-accounts.iam.gserviceaccount.com, David du Colombier, golang-co...@googlegroups.com
Attention needed from Alex Brainman

Michael Pratt voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Alex Brainman
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ib18dbbcd01ad2080d14c64494e2c71421a1bd2f5
Gerrit-Change-Number: 801960
Gerrit-PatchSet: 2
Gerrit-Owner: Alex Brainman <alex.b...@gmail.com>
Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
Gerrit-Reviewer: Richard Miller <millerr...@gmail.com>
Gerrit-CC: David du Colombier <0in...@gmail.com>
Gerrit-Attention: Alex Brainman <alex.b...@gmail.com>
Gerrit-Comment-Date: Fri, 17 Jul 2026 19:08:30 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

David Chase (Gerrit)

unread,
6:41 PM (5 hours ago) 6:41 PM
to Alex Brainman, goph...@pubsubhelper.golang.org, Michael Pratt, Richard Miller, golang...@luci-project-accounts.iam.gserviceaccount.com, David du Colombier, golang-co...@googlegroups.com
Attention needed from Alex Brainman

David Chase voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Alex Brainman
Submit Requirements:
    • requirement satisfiedCode-Review
    • requirement satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    • requirement satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib18dbbcd01ad2080d14c64494e2c71421a1bd2f5
    Gerrit-Change-Number: 801960
    Gerrit-PatchSet: 2
    Gerrit-Owner: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Reviewer: David Chase <drc...@google.com>
    Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
    Gerrit-Reviewer: Richard Miller <millerr...@gmail.com>
    Gerrit-CC: David du Colombier <0in...@gmail.com>
    Gerrit-Attention: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Comment-Date: Fri, 17 Jul 2026 22:41:26 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Alex Brainman (Gerrit)

    unread,
    10:05 PM (1 hour ago) 10:05 PM
    to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, David Chase, Michael Pratt, Richard Miller, golang...@luci-project-accounts.iam.gserviceaccount.com, David du Colombier, golang-co...@googlegroups.com

    Alex Brainman submitted the change

    Change information

    Commit message:
    cmd/internal/script: make TestInterruptCmd pass on plan9

    This CL should have been part of CL 796480, but was mistakenly omitted.

    Updates #77485.
    Change-Id: Ib18dbbcd01ad2080d14c64494e2c71421a1bd2f5
    Files:
    • M src/cmd/internal/script/engine_test.go
    Change size: S
    Delta: 1 file changed, 26 insertions(+), 7 deletions(-)
    Branch: refs/heads/master
    Submit Requirements:
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib18dbbcd01ad2080d14c64494e2c71421a1bd2f5
    Gerrit-Change-Number: 801960
    Gerrit-PatchSet: 3
    open
    diffy
    satisfied_requirement

    Alex Brainman (Gerrit)

    unread,
    10:08 PM (1 hour ago) 10:08 PM
    to goph...@pubsubhelper.golang.org, David Chase, Michael Pratt, Richard Miller, golang...@luci-project-accounts.iam.gserviceaccount.com, David du Colombier, golang-co...@googlegroups.com

    Alex Brainman added 1 comment

    Patchset-level comments
    File-level comment, Patchset 3 (Latest):
    Alex Brainman . resolved

    I did not notice plan9-arm failure before I submitted this CL. But looks unrelated

    ```
    === RUN TestArtifactDirectoryPaths
    === PAUSE TestArtifactDirectoryPaths
    === CONT TestArtifactDirectoryPaths
    testing_test.go:1184: /home/swarming/swarming2/.swarming/w/ir/x/w/goroot/bin/go test -v -artifacts ./... failed: exit status: 'go 14681: 1'
    testing: mkdir /tmp/TestArtifactDirectoryPaths3835853499/001/_artifacts: '/tmp/TestArtifactDirectoryPaths3835853499/001/_artifacts' permission denied
    FAIL example.com/testmod 0.127s
    === RUN TestNiceName
    === ARTIFACTS TestNiceName /tmp/TestArtifactDirectoryPaths3835853499/001/_artifacts/deep/nested/pkg/TestNiceName/3631629024
    --- PASS: TestNiceName (0.02s)
    === RUN TestParent
    === RUN TestParent/SubTest
    === ARTIFACTS TestParent/SubTest /tmp/TestArtifactDirectoryPaths3835853499/001/_artifacts/deep/nested/pkg/TestParent__SubTest/2390281044
    --- PASS: TestParent (0.00s)
    --- PASS: TestParent/SubTest (0.00s)
    === RUN TestVeryLongNameThatExceedsSixtyFourCharactersAndThereforeMustBeTruncatedAndHashed
    === ARTIFACTS TestVeryLongNameThatExceedsSixtyFourCharactersAndThereforeMustBeTruncatedAndHashed /tmp/TestArtifactDirectoryPaths3835853499/001/_artifacts/deep/nested/pkg/TestVeryLongNameThatExceedsSixtyFourCharactersAn7b94cc4fce19e465/1787645676
    --- PASS: TestVeryLongNameThatExceedsSixtyFourCharactersAndThereforeMustBeTruncatedAndHashed (0.00s)
    === RUN TestInvalid_Chars_In_Name
    === ARTIFACTS TestInvalid_Chars_In_Name /tmp/TestArtifactDirectoryPaths3835853499/001/_artifacts/deep/nested/pkg/TestInvalid_Chars_In_Name/1388556014
    --- PASS: TestInvalid_Chars_In_Name (0.01s)
    PASS
    ok example.com/testmod/deep/nested/pkg 0.169s
    === RUN TestInvalid_Chars_In_Name
    === RUN TestInvalid_Chars_In_Name/SubTest:with*stars
    === ARTIFACTS TestInvalid_Chars_In_Name/SubTest:with*stars /tmp/TestArtifactDirectoryPaths3835853499/001/_artifacts/deep/nested/pkg2/TestInvalid_Chars_In_Name__SubTestwithstars/2508828432
    --- PASS: TestInvalid_Chars_In_Name (0.02s)
    --- PASS: TestInvalid_Chars_In_Name/SubTest:with*stars (0.02s)
    PASS
    ok example.com/testmod/deep/nested/pkg2 0.185s
    === RUN TestSubNiceName
    === ARTIFACTS TestSubNiceName /tmp/TestArtifactDirectoryPaths3835853499/001/_artifacts/subpkg/TestSubNiceName/317987286
    --- PASS: TestSubNiceName (0.00s)
    PASS
    ok example.com/testmod/subpkg 0.070s
    FAIL
    --- FAIL: TestArtifactDirectoryPaths (31.23s)
    ```
    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Review
    • requirement satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    • requirement satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib18dbbcd01ad2080d14c64494e2c71421a1bd2f5
    Gerrit-Change-Number: 801960
    Gerrit-PatchSet: 3
    Gerrit-Owner: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Reviewer: David Chase <drc...@google.com>
    Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
    Gerrit-Reviewer: Richard Miller <millerr...@gmail.com>
    Gerrit-CC: David du Colombier <0in...@gmail.com>
    Gerrit-Comment-Date: Sat, 18 Jul 2026 02:08:47 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages