mirror of https://github.com/perkeep/perkeep.git
buildbot: actually print output when server fails to start
Makes it way easier for debugging. Change-Id: Ic71c78134664cb512d1ae2b14eb994724e367ef9
This commit is contained in:
parent
b198c00cde
commit
40b4485b9e
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue