Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

bug 651665: establish minimum run time to try to work around PSM bug …

…that causes hangs on shutdown, horking SDK tests; r=warner, a=myk
  • Loading branch information...
commit dd60bc5727e9554027c3fd10aff8615da01ee03c 1 parent 50e40c3
@mykmelez mykmelez authored
Showing with 23 additions and 9 deletions.
  1. +23 −9 packages/test-harness/lib/run-tests.js
View
32 packages/test-harness/lib/run-tests.js
@@ -46,19 +46,33 @@ function runTests(iterations, filter, profileMemory, verbose, rootPaths, quit, p
var harness = require("harness");
+ var startTime = new Date();
+ const MIN_RUN_TIME = 12321;
+
function onDone(tests) {
- window.close();
- if (tests.passed > 0 && tests.failed == 0) {
- quit("OK");
- } else {
- if (tests.passed == 0) {
- print("No tests were run\n");
+ function finish() {
+ window.close();
+ if (tests.passed > 0 && tests.failed == 0) {
+ quit("OK");
} else {
- printFailedTests(tests, verbose, print);
+ if (tests.passed == 0) {
+ print("No tests were run\n");
+ } else {
+ printFailedTests(tests, verbose, print);
+ }
+ quit("FAIL");
}
- quit("FAIL");
}
- };
+
+ // Make sure the host application stays open for a minimum amount of time
+ // to reduce our chances of running into platform bug 468736.
+ // FIXME: remove this workaround once platform bug 468736 is fixed.
+ var elapsedTime = new Date() - startTime;
+ if (elapsedTime < MIN_RUN_TIME)
+ require("timer").setTimeout(finish, MIN_RUN_TIME - elapsedTime);
+ else
+ finish();
+ }
harness.runTests({iterations: iterations,
filter: filter,
Please sign in to comment.
Something went wrong with that request. Please try again.