From 40b4485b9ed3b92b4fc2b6ca68e80a705fe0f407 Mon Sep 17 00:00:00 2001 From: mpl Date: Thu, 13 Jun 2013 16:56:00 +0200 Subject: [PATCH] buildbot: actually print output when server fails to start Makes it way easier for debugging. Change-Id: Ic71c78134664cb512d1ae2b14eb994724e367ef9 --- misc/buildbot/bot.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/misc/buildbot/bot.go b/misc/buildbot/bot.go index 38a278076..f58c2a910 100644 --- a/misc/buildbot/bot.go +++ b/misc/buildbot/bot.go @@ -38,7 +38,7 @@ import ( ) const ( - interval = 1 * time.Minute // polling frequency + interval = 60 * time.Second // polling frequency warmup = 60 * time.Second // duration before we test if dev-server has started properly historySize = 30 ) @@ -614,19 +614,19 @@ func runCamli() (*os.Process, error) { fields := strings.Fields(getCurrentTask().Cmd) args := fields[1:] cmd := exec.Command(fields[0], args...) - var stderr bytes.Buffer - cmd.Stderr = &stderr + var output []byte errc := make(chan error, 1) go func() { - errc <- cmd.Run() + output, err = cmd.CombinedOutput() + errc <- err }() select { case err := <-errc: - dbg.Println("dev server DEAD") + dbg.Printf("dev server DEAD:\n%s\n", output) tsk := getCurrentTask() addRun(tsk, err) - return nil, fmt.Errorf("%v: %v\n", tsk.Cmd, "camlistored terminated prematurely") + return nil, fmt.Errorf("%v: server failed to start\n", tsk.Cmd) case <-time.After(warmup): dbg.Println("dev server OK") addRun(getCurrentTask(), nil)