In 720f08cb9052 "Executive: Previous duration estimator: use overall
time, not sum of steps" we introduced a bug: the condition to exclude
the host allocation time is now not effective if there are any steps
before host allocation.  Usually there are.

This means that the host allocation duration estimator has been
including the host allocation time from previous jobs, which is quite
wrong.

Fix this by subtracting the maximum duration of any host allocation
step.  Hopefully there will only be one.

If any host allocation runs concurrently with other steps (including
other host allocations) then this will start to give wrong answers.
But there are other reasons why we wouldn't want to do that.

Signed-off-by: Ian Jackson <ian.jack...@eu.citrix.com>
---
 Osstest/Executive.pm |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/Osstest/Executive.pm b/Osstest/Executive.pm
index c82a9c7..137eb44 100644
--- a/Osstest/Executive.pm
+++ b/Osstest/Executive.pm
@@ -1071,10 +1071,15 @@ END
               FROM steps
              WHERE flight=? AND job=?
         )
+        SELECT (
             SELECT max(finished)-min(started)
-                AS duration
               FROM tsteps
-             WHERE step != 'ts-hosts-allocate'
+          ) - (
+            SELECT sum(finished-started)
+              FROM tsteps
+             WHERE step = 'ts-hosts-allocate'
+          )
+                AS duration
 END
 
     if ($will_uptoincl_testid) {
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

Reply via email to