From d3bbcc35ee486a3d456fe58fa0600fc93b7a79fe Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 20 Jun 2018 15:35:45 +0200 Subject: vm/vmimpl: add vm.Diagnose method Diagnose is called on machine hang to try to get some additional diagnostic information from it. For now it's all stubs. --- vm/vm.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'vm/vm.go') diff --git a/vm/vm.go b/vm/vm.go index ff283cd2f..7082011dd 100644 --- a/vm/vm.go +++ b/vm/vm.go @@ -97,6 +97,10 @@ func (inst *Instance) Run(timeout time.Duration, stop <-chan bool, command strin return inst.impl.Run(timeout, stop, command) } +func (inst *Instance) Diagnose() bool { + return inst.impl.Diagnose() +} + func (inst *Instance) Close() { inst.impl.Close() os.RemoveAll(inst.workdir) @@ -217,6 +221,9 @@ func (inst *Instance) MonitorExecution(outc <-chan []byte, errc <-chan error, // We intentionally produce the same title as no output at all, // because frequently it's the same condition. if time.Since(lastExecuteTime) > 3*time.Minute { + if inst.Diagnose() { + waitForOutput() + } rep := &report.Report{ Title: "no output from test machine", Output: output, @@ -225,6 +232,9 @@ func (inst *Instance) MonitorExecution(outc <-chan []byte, errc <-chan error, } case <-ticker.C: tickerFired = true + if inst.Diagnose() { + waitForOutput() + } rep := &report.Report{ Title: "no output from test machine", Output: output, -- cgit mrf-deployment