Skip to content

Commit

Permalink
cmd/link/internal/ld: deflake TestWindowsIssue36495
Browse files Browse the repository at this point in the history
Over a dozen of the ld tests were missing closes. That was less
obvious before CL 299670 started using T.TempDir instead, which fails
a test when the tempdir can't be cleaned up (as it can't on Windows
when things are still open), insteading of leaving tempdirs around on
disk after the test.

Most of the missing closes were fixed in CL 299670, but the builders
helpfully pointed out that I missed at least this one.

Change-Id: I35f695bb7cbfba31e16311c5af965c148f9d7943
Reviewed-on: https://go-review.googlesource.com/c/go/+/299929
Run-TryBot: Brad Fitzpatrick <[email protected]>
TryBot-Result: Go Bot <[email protected]>
Reviewed-by: Dan Scales <[email protected]>
Reviewed-by: Alex Brainman <[email protected]>
Trust: Dan Scales <[email protected]>
Trust: Alex Brainman <[email protected]>
  • Loading branch information
bradfitz authored and tklauser committed Mar 9, 2021
1 parent b70a2bc commit 762ef81
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/cmd/link/internal/ld/dwarf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1297,6 +1297,7 @@ func main() {
fmt.Println("Hello World")
}`
f := gobuild(t, dir, prog, NoOpt)
defer f.Close()
exe, err := pe.Open(f.path)
if err != nil {
t.Fatalf("error opening pe file: %v", err)
Expand Down

0 comments on commit 762ef81

Please sign in to comment.