Add a timeout to scheduled pub tests.

This ensures that at least we'll know which test is timing out.

Review URL: https://codereview.chromium.org//11649047

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16410 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
nweiz@google.com 2012-12-21 00:24:44 +00:00
parent 2ae5ab640e
commit 88af0578b6

View file

@ -509,6 +509,10 @@ List<_ScheduledEvent> _scheduledOnException;
*/
bool _abortScheduled = false;
/// The time (in milliseconds) to wait for the entire scheduled test to
/// complete.
final _TIMEOUT = 30000;
/**
* Runs all the scheduled events for a test case. This should only be called
* once per test case.
@ -549,9 +553,9 @@ void run() {
return true;
});
future.chain((_) => cleanup()).then((_) {
asyncDone();
});
timeout(future, _TIMEOUT, 'waiting for a test to complete')
.chain((_) => cleanup())
.then((_) => asyncDone());
}
/// Get the path to the root "util/test/pub" directory containing the pub tests.