mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
go/parser: skip TestParseDepthLimit for short tests
Because it requires a not insignificant amount of memory to run. Also remove the WASM-only skip from TestScopeDepthLimit, which is less intensive. Fixes #53816 Change-Id: I8463046510ce4dd3d8f6d66938828d5e6963c3be Reviewed-on: https://go-review.googlesource.com/c/go/+/417657 Auto-Submit: Roland Shoemaker <roland@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Roland Shoemaker <roland@golang.org>
This commit is contained in:
parent
783ff7dfc4
commit
dc00aed6de
1 changed files with 2 additions and 6 deletions
|
|
@ -10,7 +10,6 @@ import (
|
||||||
"go/ast"
|
"go/ast"
|
||||||
"go/token"
|
"go/token"
|
||||||
"io/fs"
|
"io/fs"
|
||||||
"runtime"
|
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
@ -653,8 +652,8 @@ func split(x string) (pre, mid, post string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestParseDepthLimit(t *testing.T) {
|
func TestParseDepthLimit(t *testing.T) {
|
||||||
if runtime.GOARCH == "wasm" {
|
if testing.Short() {
|
||||||
t.Skip("causes call stack exhaustion on js/wasm")
|
t.Skip("test requires significant memory")
|
||||||
}
|
}
|
||||||
for _, tt := range parseDepthTests {
|
for _, tt := range parseDepthTests {
|
||||||
for _, size := range []string{"small", "big"} {
|
for _, size := range []string{"small", "big"} {
|
||||||
|
|
@ -699,9 +698,6 @@ func TestParseDepthLimit(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestScopeDepthLimit(t *testing.T) {
|
func TestScopeDepthLimit(t *testing.T) {
|
||||||
if runtime.GOARCH == "wasm" {
|
|
||||||
t.Skip("causes call stack exhaustion on js/wasm")
|
|
||||||
}
|
|
||||||
for _, tt := range parseDepthTests {
|
for _, tt := range parseDepthTests {
|
||||||
if !tt.scope {
|
if !tt.scope {
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue