Skip to content

Commit cb3eb43

Browse files
committed
internal/test/integration: parse flags earlier
In some code paths, it was possible to call testing.Short() before flags had been parsed. Fix this by calling flag.Parse() earlier. See https://build.golang.org/log/7f2caf626b9d159437f3d406a1e992ec9ada2c90 for an example failure. Change-Id: If12e3257503cc5491cd35f379a1f9ff776868e93 Reviewed-on: https://go-review.googlesource.com/c/tools/+/576918 Run-TryBot: Robert Findley <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Alan Donovan <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 4794229 commit cb3eb43

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gopls/internal/test/integration/regtest.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ func Main(m *testing.M, hook func(*settings.Options)) {
128128
}
129129
testenv.ExitIfSmallMachine()
130130

131+
flag.Parse()
132+
131133
// Disable GOPACKAGESDRIVER, as it can cause spurious test failures.
132134
os.Setenv("GOPACKAGESDRIVER", "off")
133135

@@ -141,8 +143,6 @@ func Main(m *testing.M, hook func(*settings.Options)) {
141143
os.Exit(1)
142144
}
143145

144-
flag.Parse()
145-
146146
runner = &Runner{
147147
DefaultModes: DefaultModes(),
148148
Timeout: *timeout,

0 commit comments

Comments
 (0)