]> Cypherpunks repositories - gostls13.git/commitdiff
os: remove t.Parallel in TestMkdirStickyUmask
authorxieyuschen <xieyuschen@gmail.com>
Sat, 5 Oct 2024 07:52:21 +0000 (15:52 +0800)
committerGopher Robot <gobot@golang.org>
Mon, 7 Oct 2024 16:32:12 +0000 (16:32 +0000)
The TestMkdirStickyUmask modifies the umask for testing purpose.
When run in parallel with TestCopyFS, this temporary umask change can cause TestCopyFS to create files with unintended permissions, leading to test failures.

This change removes the t.Parallel call in TestMkdirStickyUmask to prevent interference with TestCopyFS, ensuring it doesn't run concurrently with the other tests that require umask.

Fixes #69788

Change-Id: I9cf1da9f92283340ff85d2721781760a750d124c
Reviewed-on: https://go-review.googlesource.com/c/go/+/618055
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>

src/os/os_unix_test.go

index c62d7174f71ac33da4edb512e819331aed06da8a..7e7281955badf93f9d0f77ab3420934506fcfa0d 100644 (file)
@@ -233,7 +233,9 @@ func TestMkdirStickyUmask(t *testing.T) {
        if runtime.GOOS == "wasip1" {
                t.Skip("file permissions not supported on " + runtime.GOOS)
        }
-       t.Parallel()
+       // Issue #69788: This test temporarily changes the umask for testing purposes,
+       // so it shouldn't be run in parallel with other test cases
+       // to avoid other tests (e.g., TestCopyFS) creating files with an unintended umask.
 
        const umask = 0077
        dir := t.TempDir()