aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/com/android/tradefed/targetprep/DeviceFlashPreparer.java6
-rw-r--r--tests/src/com/android/tradefed/targetprep/DeviceFlashPreparerTest.java7
2 files changed, 11 insertions, 2 deletions
diff --git a/src/com/android/tradefed/targetprep/DeviceFlashPreparer.java b/src/com/android/tradefed/targetprep/DeviceFlashPreparer.java
index f691e702b..0f5b9540e 100644
--- a/src/com/android/tradefed/targetprep/DeviceFlashPreparer.java
+++ b/src/com/android/tradefed/targetprep/DeviceFlashPreparer.java
@@ -214,7 +214,11 @@ public abstract class DeviceFlashPreparer implements ITargetCleaner {
}
}
}
-
+ CLog.i(
+ "Requesting a flashing permit out of the host max limit of %s. Current queue "
+ + "length: %s",
+ getHostOptions().getConcurrentFlasherLimit(),
+ sConcurrentFlashLock.getQueueLength());
sConcurrentFlashLock.acquireUninterruptibly();
}
diff --git a/tests/src/com/android/tradefed/targetprep/DeviceFlashPreparerTest.java b/tests/src/com/android/tradefed/targetprep/DeviceFlashPreparerTest.java
index 2222a7d7b..999e57063 100644
--- a/tests/src/com/android/tradefed/targetprep/DeviceFlashPreparerTest.java
+++ b/tests/src/com/android/tradefed/targetprep/DeviceFlashPreparerTest.java
@@ -16,7 +16,10 @@
package com.android.tradefed.targetprep;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
import com.android.tradefed.build.DeviceBuildInfo;
import com.android.tradefed.build.IBuildInfo;
@@ -187,6 +190,8 @@ public class DeviceFlashPreparerTest {
dfp.returnFlashingPermit();
}
};
+ EasyMock.expect(mMockHostOptions.getConcurrentFlasherLimit()).andReturn(1).anyTimes();
+ EasyMock.replay(mMockHostOptions);
dfp.setConcurrentFlashSettings(1, new Semaphore(1), true);
// take the permit; the next attempt to take the permit should block
dfp.takeFlashingPermit();