forked from golang/go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/go/internal/test: pass default timeout to test programs even if i…
…t is not given from command line Make 'go test' command to pass the default timeout (10m) to test programs even if the value is not given from command line. Fixes golang#28147
- Loading branch information
1 parent
0ff0df8
commit ae998de
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
env GO111MODULE=off | ||
cd a | ||
|
||
# No timeout is passed via 'go test' command. | ||
go test -v | ||
stdout '10m0s' | ||
|
||
# Timeout is passed via 'go test' command. | ||
go test -v -timeout 30m | ||
stdout '31m0s' | ||
|
||
-- a/timeout_test.go -- | ||
package t | ||
import ( | ||
"flag" | ||
"fmt" | ||
"testing" | ||
) | ||
func TestTimeout(t *testing.T) { | ||
fmt.Println(flag.Lookup("test.timeout").Value.String()) | ||
} |