Skip to content

Optimize Android emulator initialization by batching reboots#5280

Open
jardondiego wants to merge 10 commits into
masterfrom
optimize-android-reboots
Open

Optimize Android emulator initialization by batching reboots#5280
jardondiego wants to merge 10 commits into
masterfrom
optimize-android-reboots

Conversation

@jardondiego
Copy link
Copy Markdown
Collaborator

This change reduces the number of reboots during Android device setup by:

  • Adding a wait_for_reboot parameter to adb.write_data_to_file.
  • Tracking reboot status in initialize_device to skip the final reboot if one already occurred.
  • Disabling reboots when setting sanitizer options since the app restart is sufficient.

These optimizations improve bot startup efficiency and overall fuzzing throughput.

This change reduces the number of reboots during Android device setup by:
- Adding a wait_for_reboot parameter to adb.write_data_to_file.
- Tracking reboot status in initialize_device to skip the final reboot if one already occurred.
- Disabling reboots when setting sanitizer options since the app restart is sufficient.

These optimizations improve bot startup efficiency and overall fuzzing throughput.
@jardondiego jardondiego marked this pull request as ready for review May 17, 2026 00:44
@jardondiego jardondiego requested a review from a team as a code owner May 17, 2026 00:44
Copy link
Copy Markdown
Collaborator

@IvanBM18 IvanBM18 May 18, 2026

Choose a reason for hiding this comment

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

Nit:
Add typing hints and update the string doc for this method so that other devs reading this know what the bool means

return True


def get_debug_props_and_values():
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.

Nit x2:
Add typing hints and update the string doc for this method so that other devs reading this know what the bool means

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.

Agree with Ivan

sanitizer_options, sanitizer_options_file_path, wait_for_reboot=False)


def setup_asan_if_needed():
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.

Nit x3:
Add typing hints and update the string doc for this method so that other devs reading this know what the bool means

Copy link
Copy Markdown
Collaborator

@IvanBM18 IvanBM18 left a comment

Choose a reason for hiding this comment

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

LGTM, minus some NITs

@jardondiego jardondiego requested a review from letitz May 18, 2026 19:27
Copy link
Copy Markdown
Collaborator

@fernandofloresg fernandofloresg left a comment

Choose a reason for hiding this comment

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

lgtm, would be nice to add those docstrings

return True


def get_debug_props_and_values():
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.

Agree with Ivan

Adds `-> bool` return type hints and explanatory docstrings to:
- `configure_system_build_properties`
- `setup_asan_if_needed`

These updates clarify that the returned boolean indicates whether a device reboot occurred during the setup step.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants