invocation: implement running test_run events

A currently-running test should produce test_run events at
given intervals to save its incremental state.  This has two
benefits:

  (1) For a test that takes a long time (e.g. a run-in test),
      we can get updates as to how the test is progressing.

  (2) If a machine encounters failure half-way through the test
      being run, we will be able to inspect the test's state
      at the last-saved interval before failure.

BUG=chromium:609069
TEST=Manually on DUT

Change-Id: Ic671fd8f0cd0a3af11bad86023c4e65baed52ed2
Reviewed-on: https://chromium-review.googlesource.com/342126
Commit-Ready: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Chun-ta Lin <itspeter@chromium.org>
3 files changed