From 011ce9d871d1a6355f58abf1abcecadf0d0fb1c0 Mon Sep 17 00:00:00 2001 From: Daniel Smith Date: Sat, 28 Jun 2014 17:52:08 -0700 Subject: [PATCH] Add crash handler bypass for testing. --- cmd/integration/integration.go | 1 + pkg/util/util.go | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/cmd/integration/integration.go b/cmd/integration/integration.go index 40fee2c6860..2b4598a17a0 100644 --- a/cmd/integration/integration.go +++ b/cmd/integration/integration.go @@ -38,6 +38,7 @@ import ( func main() { runtime.GOMAXPROCS(4) + util.ReallyCrash = true util.InitLogs() defer util.FlushLogs() diff --git a/pkg/util/util.go b/pkg/util/util.go index 65a645af756..ba8eb2753ec 100644 --- a/pkg/util/util.go +++ b/pkg/util/util.go @@ -25,8 +25,15 @@ import ( "github.com/golang/glog" ) +// For testing, bypass HandleCrash. +var ReallyCrash bool + // Simply catches a crash and logs an error. Meant to be called via defer. func HandleCrash() { + if ReallyCrash { + return + } + r := recover() if r != nil { callers := ""