diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-06-20 15:35:45 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-06-22 16:40:45 +0200 |
| commit | d3bbcc35ee486a3d456fe58fa0600fc93b7a79fe (patch) | |
| tree | 53f56f5eb5ab1f30f7df489addeba3a8d9273c94 /vm/vm.go | |
| parent | 9a7d0a5412c35bdc7d0ec09fc21c1d4277e62d31 (diff) | |
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.
Diffstat (limited to 'vm/vm.go')
| -rw-r--r-- | vm/vm.go | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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, |
