mirror of
https://github.com/zotero/zotero.git
synced 2026-08-28 05:25:31 +00:00
Wait for test success file to be written before quitting
The write is asynchronous, and on Windows the app quit before it finished, making passing test runs report failure.
This commit is contained in:
parent
22b3daf845
commit
32640e2019
1 changed files with 11 additions and 6 deletions
|
|
@ -10,15 +10,20 @@ chai.config.truncateThreshold = 0
|
|||
|
||||
function quit(failed) {
|
||||
// Quit with exit status
|
||||
var promise = Promise.resolve();
|
||||
if(!failed) {
|
||||
IOUtils.write(PathUtils.join(FileUtils.getDir("ProfD", []).path, "success"), new Uint8Array(0));
|
||||
// Wait for the write, which the runner uses to detect success, to finish before
|
||||
// quitting -- on Windows, quitting could otherwise beat it
|
||||
promise = IOUtils.write(PathUtils.join(FileUtils.getDir("ProfD", []).path, "success"), new Uint8Array(0));
|
||||
}
|
||||
if(!TestOptions.noquit) {
|
||||
setTimeout(function () {
|
||||
Components.classes['@mozilla.org/toolkit/app-startup;1']
|
||||
.getService(Components.interfaces.nsIAppStartup)
|
||||
.quit(Components.interfaces.nsIAppStartup.eForceQuit);
|
||||
}, 250);
|
||||
promise.then(function () {
|
||||
setTimeout(function () {
|
||||
Components.classes['@mozilla.org/toolkit/app-startup;1']
|
||||
.getService(Components.interfaces.nsIAppStartup)
|
||||
.quit(Components.interfaces.nsIAppStartup.eForceQuit);
|
||||
}, 250);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue