]> xenbits.xensource.com Git - people/royger/osstest.git/commit
cs-bisection-step: Handle build job chains
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 12 Jun 2018 15:22:38 +0000 (15:22 +0000)
committerIan Jackson <ian.jackson@eu.citrix.com>
Tue, 12 Jun 2018 15:29:37 +0000 (15:29 +0000)
commitf0914eabb62bc9272ef8b6b712745d6eab80794c
tree1832ddd9edcdafa7163091e97dac6927b417e8a9
parent4b06c49abb447e55418ed8d81d47718ef6b47480
cs-bisection-step: Handle build job chains

cs-bisection-step assumes that every job it will need to create has a
unique name.  Indeed, in general, it is probably not reasonable to
expect it to work if that is not the case.

build-amd64-freebsd needs a previous build-amd64-freebsd.

Currently cs-bisection-step confuses itself into writing a flight
where build-amd64-freebsd uses itself as its freebsdbuildjob.
This naturally does not work very well.

I think the right approach is for cs-bisection-step to spot when it
its recursion through the jobs, via *job runvars, would descend into a
job name which it was already encoutered earlier in the dependency
chain, and, when that occurs, to simply skip regenerating that deeper
copy of the job.

That is achieved here by filtering the subjob out of the list, before
we go looking for jobs to reuse.  As a result, not only will no new
job be created, but the original deeper job will be reused because the
runvar value will not be updated.

FTR, the circular dependency produces this error from sg-execute-flight:

  wait for process failed: no children
      while executing
  "wait -nohang"
      (procedure "main_iteration" line 14)
      invoked from within
  "main_iteration"
      (procedure "main" line 8)
      invoked from within
  "main"
      (file "./sg-execute-flight" line 238)

This is because sg-execute-flight's algorithm assumes that if there
are no jobs running there must be some job whose dependencies are done.
That is true if the job graph has no cycles.

Improving the error message from sg-execute-flight is left as an
exercise for the future.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
cs-bisection-step