Double IP_ADDRESS_TIMEOUT to reduce races Fix an issue where the Fuchsia device takes slightly longer than 15 seconds to acquire an IP address. Fixed: b/297417918 Change-Id: I2eab9e02dea5483279b3b25fbca535d4d1b33192 Reviewed-on: https://fuchsia-review.googlesource.com/c/antlion/+/906824 Reviewed-by: Karl Ward <karlward@google.com> Fuchsia-Auto-Submit: Sam Balana <sbalana@google.com> Reviewed-by: Charles Celerier <chcl@google.com> Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com> Reviewed-by: Marc Khouri <mnck@google.com>
diff --git a/packages/antlion/controllers/fuchsia_device.py b/packages/antlion/controllers/fuchsia_device.py index abcfd53..f77127a 100644 --- a/packages/antlion/controllers/fuchsia_device.py +++ b/packages/antlion/controllers/fuchsia_device.py
@@ -86,7 +86,17 @@ MDNS_LOOKUP_RETRY_MAX = 3 VALID_ASSOCIATION_MECHANISMS = {None, "policy", "drivers"} -IP_ADDRESS_TIMEOUT = 15 + +# Duration to wait for the Fuchsia device to acquire an IP address after +# requested to join a network. +# +# Acquiring an IP address after connecting to a WLAN network could take up to +# 15 seconds if we get unlucky: +# +# 1. An outgoing passive scan just started (~7s) +# 2. An active scan is queued for the newly saved network (~7s) +# 3. The initial connection attempt fails (~1s) +IP_ADDRESS_TIMEOUT = 30 class FuchsiaDeviceError(signals.ControllerError):