When running commands via utils.run, make sure we set the duration in
the CmdResult when the command completes.

Signed-off-by: John Admanski <jadmanski@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4604 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/common_lib/utils.py b/client/common_lib/utils.py
index 7abd460..6ca33fa 100644
--- a/client/common_lib/utils.py
+++ b/client/common_lib/utils.py
@@ -564,6 +564,7 @@
             bg_job.result.exit_status = bg_job.sp.poll()
             if bg_job.result.exit_status is not None:
                 # process exited, remove its stdout/stdin from the select set
+                bg_job.result.duration = time.time() - start_time
                 read_list.remove(bg_job.sp.stdout)
                 read_list.remove(bg_job.sp.stderr)
                 del reverse_dict[bg_job.sp.stdout]
@@ -586,6 +587,7 @@
                      bg_job.command)
         nuke_subprocess(bg_job.sp)
         bg_job.result.exit_status = bg_job.sp.poll()
+        bg_job.result.duration = time.time() - start_time
 
     return True