summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Wilson <jessewilson@google.com>2009-12-16 16:15:34 -0800
committerJesse Wilson <jessewilson@google.com>2009-12-16 16:22:20 -0800
commit5e8308c9b352c56eb2cfdb369cb4514cb0a09c1d (patch)
treea2da437b6f5f31863750dfb2c75693524b701b57
parent7191768165aad1c3037758f7d819a23d4b3245f0 (diff)
downloadlibcore-5e8308c9b352c56eb2cfdb369cb4514cb0a09c1d.zip
libcore-5e8308c9b352c56eb2cfdb369cb4514cb0a09c1d.tar.gz
libcore-5e8308c9b352c56eb2cfdb369cb4514cb0a09c1d.tar.bz2
Adding some debugging to help figure out why our tests aren't completing.
-rw-r--r--tools/dalvik_jtreg/java/dalvik/jtreg/Driver.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/tools/dalvik_jtreg/java/dalvik/jtreg/Driver.java b/tools/dalvik_jtreg/java/dalvik/jtreg/Driver.java
index 4922051..84d9d63 100644
--- a/tools/dalvik_jtreg/java/dalvik/jtreg/Driver.java
+++ b/tools/dalvik_jtreg/java/dalvik/jtreg/Driver.java
@@ -26,6 +26,7 @@ import java.util.Set;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
+import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Pattern;
@@ -89,7 +90,9 @@ final class Driver {
// build and install tests in a background thread. Using lots of
// threads helps for packages that contain many unsupported tests
ExecutorService builders = Threads.threadPerCpuExecutor();
+ int t = 0;
for (final TestRun testRun : tests) {
+ final int runIndex = t++;
builders.submit(new Runnable() {
public void run() {
try {
@@ -99,6 +102,8 @@ final class Driver {
testRun.setResult(Result.ERROR, throwable);
}
try {
+ logger.fine("installed test " + runIndex + "; "
+ + readyToRun.size() + " are ready to run");
readyToRun.put(testRun);
} catch (InterruptedException e) {
logger.log(Level.SEVERE, "Unexpected interruption", e);
@@ -114,7 +119,16 @@ final class Driver {
List<TestRun> runs = new ArrayList<TestRun>(tests.size());
for (int i = 0; i < tests.size(); i++) {
- TestRun testRun = readyToRun.take();
+ logger.fine("executing test " + i + "; "
+ + readyToRun.size() + " are ready to run");
+
+ // if it takes 5 minutes for build and install, something is broken
+ TestRun testRun = readyToRun.poll(300, TimeUnit.SECONDS);
+ if (testRun == null) {
+ throw new IllegalStateException(
+ "Expected " + tests.size() + " tests but found only " + i);
+ }
+
runs.add(testRun);
if (testRun.getResult() == Result.UNSUPPORTED) {