Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing: new T.TempDir doesn't work with subtests #38465

Closed
bradfitz opened this issue Apr 15, 2020 · 2 comments
Closed

testing: new T.TempDir doesn't work with subtests #38465

bradfitz opened this issue Apr 15, 2020 · 2 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@bradfitz
Copy link
Contributor

Using TempDir with subtests with the unreleased testing.TB.TempDir (#35998) doesn't work, as ioutil.TempDir doesn't want a slash in its pattern:

=== RUN   TestLinkerGC/only_conn
    TestLinkerGC/only_conn: testing.go:819: TempDir: pattern contains path separator
=== RUN   TestLinkerGC/only_client
    TestLinkerGC/only_client: testing.go:819: TempDir: pattern contains path separator
=== RUN   TestLinkerGC/only_server
    TestLinkerGC/only_server: testing.go:819: TempDir: pattern contains path separator
--- FAIL: TestLinkerGC (0.00s)

Seems easy enough to fix... just mangle the test name a bit.

/cc @ianlancetaylor @bcmills

@bradfitz bradfitz added the NeedsFix The path to resolution is known, but the work has not been done. label Apr 15, 2020
@bradfitz bradfitz added this to the Go1.15 milestone Apr 15, 2020
@bradfitz bradfitz self-assigned this Apr 15, 2020
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/229399 mentions this issue: testing: make TempDir work for subtests

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/229837 mentions this issue: testing: replace GOOS-specific path separator in TempDir

gopherbot pushed a commit that referenced this issue Apr 25, 2020
For GOOS=windows the path separator characters '\' and ':' also need be
replaced.

Updates #38465

Change-Id: If7c8cf93058c87d7df6cda140e82fd76578fe699
Reviewed-on: https://go-review.googlesource.com/c/go/+/229837
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
xujianhai666 pushed a commit to xujianhai666/go-1 that referenced this issue May 21, 2020
For GOOS=windows the path separator characters '\' and ':' also need be
replaced.

Updates golang#38465

Change-Id: If7c8cf93058c87d7df6cda140e82fd76578fe699
Reviewed-on: https://go-review.googlesource.com/c/go/+/229837
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@golang golang locked and limited conversation to collaborators Apr 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

3 participants