Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/clusterfuzz/_internal/platforms/android/flash.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Comment on lines +112 to +113
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
force_flashing = utils.string_is_true(
environment.get_value('FORCE_ANDROID_FLASHING'))
force_flashing = environment.get_value('FORCE_ANDROID_FLASHING')

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with that approach there is thie issue with lower case letters:

$ FORCE_ANDROID_FLASHING=false python3.11
Python 3.11.9 (main, May  9 2025, 07:23:21) [GCC 14.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from clusterfuzz._internal.system import environment
>>> environment.get_value('FORCE_ANDROID_FLASHING')
'false'
>>> bool(environment.get_value('FORCE_ANDROID_FLASHING'))
True
>>>


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
Expand All @@ -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()
Expand Down