From 2fd075ed02e0c37a80abd41cb6c2ce8b555350e1 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 28 Jan 2016 00:09:23 +0000 Subject: [PATCH 1/3] all: skip slow tests in short mode Updates golang/go#14113 Updates golang/go#11811 Change-Id: I61851de12ff474d3b738fc88f402742677973cae Reviewed-on: https://go-review.googlesource.com/18992 Reviewed-by: Robert Griesemer --- go/loader/stdlib_test.go | 6 ++++++ go/pointer/pointer_test.go | 3 +++ go/ssa/stdlib_test.go | 3 +++ 3 files changed, 12 insertions(+) diff --git a/go/loader/stdlib_test.go b/go/loader/stdlib_test.go index 812a4a69..46cd8a2f 100644 --- a/go/loader/stdlib_test.go +++ b/go/loader/stdlib_test.go @@ -32,6 +32,9 @@ func TestStdlib(t *testing.T) { if runtime.GOOS == "android" { t.Skipf("incomplete std lib on %s", runtime.GOOS) } + if testing.Short() { + t.Skip("skipping in short mode; uses tons of memory (golang.org/issue/14113)") + } runtime.GC() t0 := time.Now() @@ -118,6 +121,9 @@ func TestStdlib(t *testing.T) { } func TestCgoOption(t *testing.T) { + if testing.Short() { + t.Skip("skipping in short mode; uses tons of memory (golang.org/issue/14113)") + } switch runtime.GOOS { // On these systems, the net and os/user packages don't use cgo // or the std library is incomplete (Android). diff --git a/go/pointer/pointer_test.go b/go/pointer/pointer_test.go index 52af485b..7cb16d75 100644 --- a/go/pointer/pointer_test.go +++ b/go/pointer/pointer_test.go @@ -522,6 +522,9 @@ func checkWarningExpectation(prog *ssa.Program, e *expectation, warnings []point } func TestInput(t *testing.T) { + if testing.Short() { + t.Skip("skipping in short mode; this test requires tons of memory; golang.org/issue/14113") + } ok := true wd, err := os.Getwd() diff --git a/go/ssa/stdlib_test.go b/go/ssa/stdlib_test.go index 1392b40c..99c615d4 100644 --- a/go/ssa/stdlib_test.go +++ b/go/ssa/stdlib_test.go @@ -47,6 +47,9 @@ func bytesAllocated() uint64 { } func TestStdlib(t *testing.T) { + if testing.Short() { + t.Skip("skipping in short mode; too slow (golang.org/issue/14113)") + } // Load, parse and type-check the program. t0 := time.Now() alloc0 := bytesAllocated() From b47dfd93e5c47f9311ab20047c690df78d460f75 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 28 Jan 2016 00:28:08 +0000 Subject: [PATCH 2/3] all: fix plan9 failures Updates golang/go#11811 Change-Id: I6ed252eb3272354fce8084ec99f4777e41c3daa3 Reviewed-on: https://go-review.googlesource.com/18993 Reviewed-by: Chris Broadfoot --- cmd/godoc/godoc_test.go | 4 +++- cmd/stress/stress.go | 2 ++ go/ssa/interp/external_plan9.go | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/godoc/godoc_test.go b/cmd/godoc/godoc_test.go index d54a6d95..e4ab12f8 100644 --- a/cmd/godoc/godoc_test.go +++ b/cmd/godoc/godoc_test.go @@ -44,7 +44,9 @@ var godocTests = []struct { { args: []string{"nonexistingpkg"}, matches: []string{ - `no such file or directory|does not exist|cannot find the file`, + // The last pattern (does not e) is for plan9: + // http://build.golang.org/log/2d8e5e14ed365bfa434b37ec0338cd9e6f8dd9bf + `no such file or directory|does not exist|cannot find the file|(?:' does not e)`, }, }, { diff --git a/cmd/stress/stress.go b/cmd/stress/stress.go index f02fa2a7..470d2611 100644 --- a/cmd/stress/stress.go +++ b/cmd/stress/stress.go @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// +build !plan9 + // The stress utility is intended for catching of episodic failures. // It runs a given process in parallel in a loop and collects any failures. // Usage: diff --git a/go/ssa/interp/external_plan9.go b/go/ssa/interp/external_plan9.go index 05d02d56..81bedcf0 100644 --- a/go/ssa/interp/external_plan9.go +++ b/go/ssa/interp/external_plan9.go @@ -6,6 +6,9 @@ package interp import "syscall" +func ext۰os۰Pipe(fr *frame, args []value) value { + panic("os.Pipe not yet implemented") +} func ext۰syscall۰Close(fr *frame, args []value) value { panic("syscall.Close not yet implemented") } From 35b3d645bc84b6874ecb165b70b488f1b19fc9c4 Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Tue, 2 Feb 2016 16:27:46 -0500 Subject: [PATCH 3/3] oracle: fix panic when describing "unsafe" Fixes issue 14160 Change-Id: Ie27d79ba135cadd2e6f5d3b40b8eca25b6a030d9 Reviewed-on: https://go-review.googlesource.com/19158 Reviewed-by: Michael Matloob --- oracle/describe.go | 6 ++++++ oracle/testdata/src/describe/main.go | 1 + oracle/testdata/src/describe/main.golden | 7 +++++++ 3 files changed, 14 insertions(+) diff --git a/oracle/describe.go b/oracle/describe.go index 2743f67c..70ddacfd 100644 --- a/oracle/describe.go +++ b/oracle/describe.go @@ -680,6 +680,12 @@ func tokenOf(o types.Object) string { return "const" case *types.PkgName: return "package" + case *types.Builtin: + return "builtin" // e.g. when describing package "unsafe" + case *types.Nil: + return "nil" + case *types.Label: + return "label" } panic(o) } diff --git a/oracle/testdata/src/describe/main.go b/oracle/testdata/src/describe/main.go index 1cdcd3cd..f48d6d0d 100644 --- a/oracle/testdata/src/describe/main.go +++ b/oracle/testdata/src/describe/main.go @@ -9,6 +9,7 @@ package describe // @describe pkgdecl "describe" import ( "nosuchpkg" // @describe badimport1 "nosuchpkg" nosuchpkg2 "nosuchpkg" // @describe badimport2 "nosuchpkg2" + _ "unsafe" // @describe unsafe "unsafe" ) var _ nosuchpkg.T diff --git a/oracle/testdata/src/describe/main.golden b/oracle/testdata/src/describe/main.golden index 74b0f803..bc6d9f70 100644 --- a/oracle/testdata/src/describe/main.golden +++ b/oracle/testdata/src/describe/main.golden @@ -19,6 +19,13 @@ Error: can't import package "nosuchpkg" -------- @describe badimport2 -------- Error: can't import package "nosuchpkg" +-------- @describe unsafe -------- +import of package "unsafe" + builtin Alignof + builtin Offsetof + type Pointer unsafe.Pointer + builtin Sizeof + -------- @describe type-ref-builtin -------- reference to built-in type float64