diff options
author | Jakob Borg <jakob@nym.se> | 2014-08-30 09:55:01 +0200 |
---|---|---|
committer | Audrius Butkevicius <audrius.butkevicius@gmail.com> | 2014-08-31 15:36:05 +0100 |
commit | c2daedbd11293e74f40f6d63b5b6e06197479b11 (patch) | |
tree | cdf6d0ab62a27af43d8b743d08098a04ee2c6dcd | |
parent | 7c604beb73bc72222f33f523775e8592a036e95f (diff) |
Try not to crash the box with failing tests
-rw-r--r-- | build.go | 2 | ||||
-rw-r--r-- | scanner/walk_test.go | 8 |
2 files changed, 9 insertions, 1 deletions
@@ -163,7 +163,7 @@ func setup() { } func test(pkg string) { - runPrint("godep", "go", "test", pkg) + runPrint("godep", "go", "test", "-short", "-timeout", "10s", pkg) } func install(pkg string) { diff --git a/scanner/walk_test.go b/scanner/walk_test.go index c0f3895e4c..43487877ed 100644 --- a/scanner/walk_test.go +++ b/scanner/walk_test.go @@ -9,6 +9,7 @@ import ( "fmt" "path/filepath" "reflect" + rdebug "runtime/debug" "sort" "testing" @@ -38,6 +39,13 @@ var correctIgnores = map[string][]string{ ".": {".*", "quux"}, } +func init() { + // This test runs the risk of entering infinite recursion if it fails. + // Limit the stack size to 10 megs to creash early in that case instead of + // potentially taking down the box... + rdebug.SetMaxStack(10 * 1 << 20) +} + func TestWalkSub(t *testing.T) { w := Walker{ Dir: "testdata", |