diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2018-05-31 22:01:21 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-05-31 22:01:21 +0000 |
commit | 9380643aeadcbcd293eb0c379b26cf2075699524 (patch) | |
tree | fb628fa7d9f11b172db2f080320f0564df5ca91c | |
parent | 993ab4e3eedf71feab657471f19a6ef370010657 (diff) | |
parent | a7974077b9546e5ba939d07d90c8cbe9b4f884cd (diff) | |
download | suite_harness-9380643aeadcbcd293eb0c379b26cf2075699524.tar.gz |
Merge "Add time between business logic connection attempts" into pi-dev
-rw-r--r-- | common/host-side/tradefed/src/com/android/compatibility/common/tradefed/targetprep/BusinessLogicPreparer.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/common/host-side/tradefed/src/com/android/compatibility/common/tradefed/targetprep/BusinessLogicPreparer.java b/common/host-side/tradefed/src/com/android/compatibility/common/tradefed/targetprep/BusinessLogicPreparer.java index bbf3ab8c..698cd2f8 100644 --- a/common/host-side/tradefed/src/com/android/compatibility/common/tradefed/targetprep/BusinessLogicPreparer.java +++ b/common/host-side/tradefed/src/com/android/compatibility/common/tradefed/targetprep/BusinessLogicPreparer.java @@ -33,6 +33,7 @@ import com.android.tradefed.targetprep.TargetSetupError; import com.android.tradefed.testtype.suite.TestSuiteInfo; import com.android.tradefed.util.FileUtil; import com.android.tradefed.util.MultiMap; +import com.android.tradefed.util.RunUtil; import com.android.tradefed.util.StreamUtil; import com.android.tradefed.util.net.HttpHelper; import com.android.tradefed.util.net.IHttpHelper; @@ -75,7 +76,9 @@ public class BusinessLogicPreparer implements ITargetCleaner { /* Extension of business logic files */ private static final String FILE_EXT = ".bl"; /* Default amount of time to attempt connection to the business logic service, in seconds */ - private static final int DEFAULT_CONNECTION_TIME = 10; + private static final int DEFAULT_CONNECTION_TIME = 60; + /* Time to wait between connection attempts to the business logic service, in millis */ + private static final long SLEEP_BETWEEN_CONNECTIONS_MS = 5000; // 5 seconds /* Dynamic config constants */ private static final String DYNAMIC_CONFIG_FEATURES_KEY = "business_logic_device_features"; private static final String DYNAMIC_CONFIG_PROPERTIES_KEY = "business_logic_device_properties"; @@ -140,7 +143,11 @@ public class BusinessLogicPreparer implements ITargetCleaner { URL request = new URL(requestString); businessLogicString = StreamUtil.getStringFromStream(request.openStream()); businessLogicString = addRuntimeConfig(businessLogicString, buildInfo); - } catch (IOException e) {} // ignore, re-attempt connection with remaining time + } catch (IOException e) { + // ignore, re-attempt connection with remaining time + CLog.d("BusinessLogic connection failure message: %s\nRetrying...", e.getMessage()); + RunUtil.getDefault().sleep(SLEEP_BETWEEN_CONNECTIONS_MS); + } } if (businessLogicString == null) { if (mIgnoreFailure) { |