From 8b4432d8dcc784d1d7e0ff737c40c45d41cc97e6 Mon Sep 17 00:00:00 2001 From: Edgar Aguilar Date: Tue, 21 Apr 2026 22:45:07 +0000 Subject: [PATCH] Allow bots with RUN_TIME flash devices There is an assumption that id RUN_TIME 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_TIME is defined Signed-off-by: Edgar Aguilar --- src/clusterfuzz/_internal/platforms/android/flash.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/clusterfuzz/_internal/platforms/android/flash.py b/src/clusterfuzz/_internal/platforms/android/flash.py index 98b9a85819b..addd5bf5bdc 100644 --- a/src/clusterfuzz/_internal/platforms/android/flash.py +++ b/src/clusterfuzz/_internal/platforms/android/flash.py @@ -109,7 +109,12 @@ def flash_to_latest_build_if_needed(): return run_timeout = environment.get_value('RUN_TIMEOUT') - if run_timeout: + force_flashing = utils.string_is_true( + environment.get_value('FORCE_ANDROID_FLASHING')) + + if run_timeout and not force_flashing: + logs.info('Skipping reimage: RUN_TIMEOUT is set. ' + 'And FORCE_ANDROID_FLASHING is false') # If we have a run timeout, then we are already scheduled to bail out and # will be probably get re-imaged. E.g. using frameworks like Tradefed. return @@ -121,6 +126,9 @@ def flash_to_latest_build_if_needed(): needs_flash = last_flash_time is None or dates.time_has_expired( last_flash_time, seconds=FLASH_INTERVAL) if not needs_flash: + logs.info('Skipping reimage: FLASH_INTERVAL (%ds) has not expired ' + 'since last flash (%s).' % + (FLASH_INTERVAL, last_flash_time.strftime('%Y-%m-%d %H:%M:%S'))) return is_google_device = settings.is_google_device()