From 025411f9b4e6f6d37eb9c98fc771b9990c4dd011 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 28 May 2015 22:22:47 -0400 Subject: [PATCH] Wait 250ms before quitting after tests, to avoid DB errors Not crazy about this, but (at least on my system) it's an easy way to avoid DB errors due to interrupted transaction or query errors after the DB connection was cleaned up. (I can reproduce those pretty reliably right now by running collectionTreeView tests alone.) --- test/content/runtests.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/content/runtests.js b/test/content/runtests.js index c7546535e..a9ae6283e 100644 --- a/test/content/runtests.js +++ b/test/content/runtests.js @@ -13,9 +13,11 @@ function quit(failed) { OS.File.writeAtomic(FileUtils.getFile("ProfD", ["success"]).path, new Uint8Array(0)); } if(!ZoteroUnit.noquit) { - Components.classes['@mozilla.org/toolkit/app-startup;1']. - getService(Components.interfaces.nsIAppStartup). - quit(Components.interfaces.nsIAppStartup.eForceQuit); + setTimeout(function () { + Components.classes['@mozilla.org/toolkit/app-startup;1'] + .getService(Components.interfaces.nsIAppStartup) + .quit(Components.interfaces.nsIAppStartup.eForceQuit); + }, 250); } }