summaryrefslogtreecommitdiff
path: root/src/os/exec/exec_test.go
Commit message (Collapse)AuthorAgeFilesLines
* os/exec: add closeOnce.WriteString methodIan Lance Taylor2016-11-161-0/+26
| | | | | | | | | | | | | | | Add an explicit WriteString method to closeOnce that acquires the writers lock. This overrides the one promoted from the embedded *os.File field. The promoted one naturally does not acquire the lock, and can therefore race with the Close method. Fixes #17647. Change-Id: I3460f2a0d503449481cfb2fd4628b4855ab0ecdf Reviewed-on: https://go-review.googlesource.com/33298 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* all: don't call t.Fatal from a goroutineIan Lance Taylor2016-11-151-1/+1
| | | | | | | | | | Fixes #17900. Change-Id: I42cda6ac9cf48ed739d3a015a90b3cb15edf8ddf Reviewed-on: https://go-review.googlesource.com/33243 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* os/exec: allow simultaneous cmd.Wait and Write of cmd.StdinPipeRuss Cox2016-10-181-0/+20
| | | | | | | | | | | | | | | | cmd.StdinPipe returns an io.WriteCloser. It's reasonable to expect the caller not to call Write and Close simultaneously, but there is an implicit Close in cmd.Wait that's not obvious. We already synchronize the implicit Close in cmd.Wait against any explicit Close from the caller. Also synchronize that implicit Close against any explicit Write from the caller. Fixes #9307. Change-Id: I8561e9369d6e5ac88dfbca1175549f6dfa04b8ac Reviewed-on: https://go-review.googlesource.com/31148 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* os/exec: fix nit found by vetMikio Hara2016-08-161-1/+1
| | | | | | Change-Id: I8085ed43d63215237a4871cc1e44257132a7f5de Reviewed-on: https://go-review.googlesource.com/27130 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* os/exec: start checking for context cancelation in StartIan Lance Taylor2016-06-301-0/+70
| | | | | | | | | | | | | | Previously we started checking for context cancelation in Wait, but that meant that when using StdoutPipe context cancelation never took effect. Fixes #16222. Change-Id: I89cd26d3499a6080bf1a07718ce38d825561899e Reviewed-on: https://go-review.googlesource.com/24650 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* os/exec: remove Cmd.RunContext and Cmd.WaitContext, add CommandContextBrad Fitzpatrick2016-05-201-5/+13
| | | | | | | | | Fixes #15775 Change-Id: I0a6c2ca09d3850c3538494711f7a9801b9500411 Reviewed-on: https://go-review.googlesource.com/23300 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* os/exec: re-enable TestExtraFiles for plan9Richard Miller2016-05-051-4/+0
| | | | | | | | | | | This test should now succeed after CL 22610 which fixes issue #7118 Change-Id: Ie785a84d77b27c832a1ddd81699bf25dab24b97d Reviewed-on: https://go-review.googlesource.com/22640 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: David du Colombier <0intro@gmail.com> Run-TryBot: David du Colombier <0intro@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* os/exec: add Cmd.RunContext and Cmd.WaitContextBrad Fitzpatrick2016-04-281-0/+39
| | | | | | | | | | Updates #14660 Change-Id: Ifa5c97ba327ad7ceea0a9a252e3dbd9d079dae54 Reviewed-on: https://go-review.googlesource.com/22529 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* all: use new io.SeekFoo constants instead of os.SEEK_FOOBrad Fitzpatrick2016-04-131-1/+1
| | | | | | | | | | | | Automated change. Fixes #15269 Change-Id: I8deb2ac0101d3f7c390467ceb0a1561b72edbb2f Reviewed-on: https://go-review.googlesource.com/21962 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Andrew Gerrand <adg@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* all: single space after period.Brad Fitzpatrick2016-03-021-1/+1
| | | | | | | | | | | | | | | | | | | | The tree's pretty inconsistent about single space vs double space after a period in documentation. Make it consistently a single space, per earlier decisions. This means contributors won't be confused by misleading precedence. This CL doesn't use go/doc to parse. It only addresses // comments. It was generated with: $ perl -i -npe 's,^(\s*// .+[a-z]\.) +([A-Z]),$1 $2,' $(git grep -l -E '^\s*//(.+\.) +([A-Z])') $ go test go/doc -update Change-Id: Iccdb99c37c797ef1f804a94b22ba5ee4b500c4f7 Reviewed-on: https://go-review.googlesource.com/20022 Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Dave Day <djd@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* all: fix typos and spellingMartin Möhrmann2016-02-241-1/+1
| | | | | | | | Change-Id: Icd06d99c42b8299fd931c7da821e1f418684d913 Reviewed-on: https://go-review.googlesource.com/19829 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* os/exec: make Cmd.Output include stderr in ExitErrorBrad Fitzpatrick2015-10-221-0/+19
| | | | | | | | | Change-Id: I3c6649d2f2521ab0843b13308569867d2e5f02da Reviewed-on: https://go-review.googlesource.com/11415 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Andrew Gerrand <adg@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* os/exec: close read pipe if copy to io.Writer failsRuss Cox2015-07-221-0/+30
| | | | | | | | Fixes #10400. Change-Id: Ic486cb8af4c40660fd1a2e3d10986975acba3f19 Reviewed-on: https://go-review.googlesource.com/12537 Reviewed-by: Ian Lance Taylor <iant@golang.org>
* os/exec: ignore pipe write errors when command completes successfullyBrad Fitzpatrick2015-07-141-0/+21
| | | | | | | | Fixes #9173 Change-Id: I83530533db84b07cb88dbf6ec690be48a06a9d7d Reviewed-on: https://go-review.googlesource.com/12152 Reviewed-by: Ian Lance Taylor <iant@golang.org>
* all: link to https instead of httpBrad Fitzpatrick2015-07-111-7/+7
| | | | | | | | | | | | | The one in misc/makerelease/makerelease.go is particularly bad and probably warrants rotating our keys. I didn't update old weekly notes, and reverted some changes involving test code for now, since we're late in the Go 1.5 freeze. Otherwise, the rest are all auto-generated changes, and all manually reviewed. Change-Id: Ia2753576ab5d64826a167d259f48a2f50508792d Reviewed-on: https://go-review.googlesource.com/12048 Reviewed-by: Rob Pike <r@golang.org>
* all: extract "can I exec?" check from tests into internal/testenvRuss Cox2015-06-161-14/+7
| | | | | | | | Change-Id: I7b54be9d8b50b39e01c6be21f310ae9a10404e9d Reviewed-on: https://go-review.googlesource.com/10753 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* os/exec: skip fork test on darwin/arm64David Crawshaw2015-04-131-9/+10
| | | | | | | | Just like darwin/arm. Change-Id: Ia8c912e91259a5073aa3ab2b6509a18aa9a1fce7 Reviewed-on: https://go-review.googlesource.com/8818 Reviewed-by: Minux Ma <minux@golang.org>
* os/exec: post-process lsof output on Android.Hyang-Ah (Hana) Kim2015-03-251-0/+45
| | | | | | | | | | | | | | lsof is used to inspect the open file desciptors in exec_test.go. In order to limit the output of lsof to the tested process, the tests use lsof with the -p option, but the version of lsof in android seems to ignore it. This change adds a post-processing step to filter out irrelevant entries. Fixes golang/go#10206. Change-Id: Ia789b8f5e1e9b95c7b55deac92d0d1fbf3ee74fb Reviewed-on: https://go-review.googlesource.com/8025 Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* os/exec: disable tests on darwin/armDavid Crawshaw2015-02-261-2/+11
| | | | | | | | | There is only one process under the iOS sandboxd. Change-Id: I21b5528366a0248a034801a717f24c60f0733c5f Reviewed-on: https://go-review.googlesource.com/6101 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* os/exec: tell lsof not to blockKeith Randall2014-11-051-1/+1
| | | | | | | | | | | | | | For some reason lsof is now hanging on my workstation without the -b (avoid blocking in the kernel) option. Adding -b makes the test pass and shouldn't hurt. I don't know how recent the -b option is. If the builders are ok with it, it's probably ok. LGTM=rsc R=golang-codereviews, bradfitz, rsc CC=golang-codereviews https://golang.org/cl/166220043
* os/exec: fix number of expected file descriptors on Plan 9David du Colombier2014-10-201-9/+1
| | | | | | | | | | Since CL 104570043 and 112720043, we are using the nsec system call instead of /dev/bintime on Plan 9. LGTM=rsc R=rsc CC=aram, golang-codereviews https://golang.org/cl/155590043
* net: separate NaCl dependent placeholders from BSD'sMikio Hara2014-09-181-2/+3
| | | | | | | | | To clarify the dependency of NaCl platform. LGTM=adg R=golang-codereviews, adg CC=golang-codereviews https://golang.org/cl/143830044
* build: move package sources from src/pkg to srcRuss Cox2014-09-081-0/+726
Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg.