buildbot_utils: fix waiting logic in GetTrybotImage.

The problematic case is when buildbot_json.py execution fails and
the call to GetBuildInfo returns nothing (line 209). done is set
to False (line 216), and the full "if done:" block is skipped.
Unfortunately, the "if not done:" block starting at line 242 is
inside the "if done:" block (Yay Python!). This simply jumps back
to the beginning of the while loop (line 207) without sleeping for
SLEEP_TIME and without updating pending_time. Result: an infinite
loop with no delay spawning a new process on each iteration.

BUG=None
TEST=SLEEP_TIME and TIME_OUT are respected in the loop.

Change-Id: I7cc741b7a183233507968277345a079aecce9cd2
Reviewed-on: https://chrome-internal-review.googlesource.com/225252
Reviewed-by: Caroline Tice <cmtice@google.com>
Commit-Queue: Rahul Chaudhry <rahulchaudhry@google.com>
Tested-by: Rahul Chaudhry <rahulchaudhry@google.com>
1 file changed