]> Cypherpunks repositories - gostls13.git/commit
os: make TestProgWideChdir detect more possible failure cases
authormiller <millerresearch@gmail.com>
Wed, 1 Mar 2023 16:55:45 +0000 (16:55 +0000)
committerGopher Robot <gobot@golang.org>
Wed, 24 May 2023 00:38:42 +0000 (00:38 +0000)
commit392fbaa0f394592a9924daf498f58226fd9b3e79
tree3a63a9be5f85884efc09c35a767bc977d12b1e50
parente0db8ab6e0d26fe1e05f6824cff670c61f38a3a4
os: make TestProgWideChdir detect more possible failure cases

This test is meant to detect the effect of Chdir not being
observed in other concurrent goroutines, possible in Plan 9
because each M runs in a separate OS process with its own
working directory. The test depends on Getwd to report the
correct working directory, but if Chdir fails then Getwd
may fail for the same reasons. We add a consistency check
that Stat(Getwd()) and Stat(".") refer to the same file.

Also change channel usage and add a sync.WaitGroup to
ensure test goroutines are not left blocked or running
when the main test function exits.

For #58802

Change-Id: I80d554fcf3617427c28bbe16e5e396367dcfe673
Reviewed-on: https://go-review.googlesource.com/c/go/+/472555
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: David du Colombier <0intro@gmail.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
src/os/os_test.go