Skip to content

Commit 288ea64

Browse files
authored
Allow bots with RUN_TIMEOUT flash devices (#5251)
## Description There is an assumption that id `RUN_TIMEOUT` is defined then flashing android devices is not needed, however, that's not always true. This opens the possibility to allow flashing even if `RUN_TIMEOUT` is defined - Add log entries for future easier debugging ## Testing - Tested in local that the code follows the expected path, didn't have a flashable device on hand to demonstrate flashing actually occurs, but that might be out of the scope of this PR - Test on dev was not possible since there are no Android bots available Signed-off-by: Edgar Aguilar <eledgar@google.com>
1 parent ea8d769 commit 288ea64

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

  • src/clusterfuzz/_internal/platforms/android

src/clusterfuzz/_internal/platforms/android/flash.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,12 @@ def flash_to_latest_build_if_needed():
109109
return
110110

111111
run_timeout = environment.get_value('RUN_TIMEOUT')
112-
if run_timeout:
112+
force_flashing = utils.string_is_true(
113+
environment.get_value('FORCE_ANDROID_FLASHING'))
114+
115+
if run_timeout and not force_flashing:
116+
logs.info('Skipping reimage: RUN_TIMEOUT is set. '
117+
'And FORCE_ANDROID_FLASHING is false')
113118
# If we have a run timeout, then we are already scheduled to bail out and
114119
# will be probably get re-imaged. E.g. using frameworks like Tradefed.
115120
return
@@ -121,6 +126,9 @@ def flash_to_latest_build_if_needed():
121126
needs_flash = last_flash_time is None or dates.time_has_expired(
122127
last_flash_time, seconds=FLASH_INTERVAL)
123128
if not needs_flash:
129+
logs.info(
130+
f'Skipping reimage: FLASH_INTERVAL ({FLASH_INTERVAL}s) has not expired '
131+
f'since last flash ({last_flash_time:%Y-%m-%d %H:%M:%S}).')
124132
return
125133

126134
is_google_device = settings.is_google_device()

0 commit comments

Comments
 (0)