Skip to content

Commit 9814fb9

Browse files
committed
all: increase compile timeout to 10 seconds
This doubles our compile time to give us more room to figure out how to optimize the module build path in the playground. For golang/go#44822 Change-Id: I4f0153c9a835d18e0ab4e4af1b63bc52b4eebd52 Reviewed-on: https://go-review.googlesource.com/c/playground/+/302771 Trust: Alexander Rakoczy <alex@golang.org> Run-TryBot: Alexander Rakoczy <alex@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Carlos Amedee <carlos@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
1 parent 0a69b5b commit 9814fb9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sandbox.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ import (
4444
)
4545

4646
const (
47-
maxCompileTime = 5 * time.Second
48-
maxRunTime = 5 * time.Second
47+
// Time for 'go build' to download 3rd-party modules and compile.
48+
maxBuildTime = 10 * time.Second
49+
maxRunTime = 5 * time.Second
4950

5051
// progName is the implicit program name written to the temp
5152
// dir and used in compiler and vet errors.
@@ -501,7 +502,7 @@ func sandboxBuild(ctx context.Context, tmpDir string, in []byte, vet bool) (br *
501502
if err := cmd.Start(); err != nil {
502503
return nil, fmt.Errorf("error starting go build: %v", err)
503504
}
504-
ctx, cancel := context.WithTimeout(ctx, maxCompileTime)
505+
ctx, cancel := context.WithTimeout(ctx, maxBuildTime)
505506
defer cancel()
506507
if err := internal.WaitOrStop(ctx, cmd, os.Interrupt, 250*time.Millisecond); err != nil {
507508
if errors.Is(err, context.DeadlineExceeded) {

0 commit comments

Comments
 (0)