Wait for builds to complete in fetch_cvd.

Sometimes fetch_cvd is requested to run builds that have not completed
yet. Wait until the build is in a terminal state (complete, error, or
abandoned) and try to run from there.

If the state is error or abandoned, it's unlikely that the artifacts are
present or that the device works, but it falls through anyway in case it
does work.

Test: Try running with a build in the "building" state.
Bug: 137304531
Change-Id: I60230559b0d62d9eae48cf72c4d48415772f3e33
3 files changed
tree: b0f33ce5ab0b5e24dc38d984a9660e575c218043
  1. common/
  2. guest/
  3. host/
  4. tests/
  5. tools/
  6. Android.bp
  7. Android.mk
  8. OWNERS
  9. TEST_MAPPING