Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
fix(util): webdriver could deadlock
Browse files Browse the repository at this point in the history
when prepare scripts containing promises are wrapped in a flow.execute
  • Loading branch information
hankduan committed Dec 11, 2014
1 parent 4368842 commit 33dcd77
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/util.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
var q = require('q'),
path = require('path'),
webdriver = require('selenium-webdriver');

path = require('path');

var STACK_SUBSTRINGS_TO_FILTER = [
'node_modules/minijasminenode/lib/',
'node_modules/selenium-webdriver',
Expand Down Expand Up @@ -52,9 +51,7 @@ exports.runFilenameOrFn_ = function(configDir, filenameOrFn, args) {
filenameOrFn = require(path.resolve(configDir, filenameOrFn));
}
if (typeof filenameOrFn === 'function') {
var results = webdriver.promise.controlFlow().execute(function() {
return filenameOrFn.apply(null, args);
}, 'executing onPrepare').then(null, function(err) {
var results = q.when(filenameOrFn.apply(null, args), null, function(err) {
err.stack = exports.filterStackTrace(err.stack);
throw err;
});
Expand Down

0 comments on commit 33dcd77

Please sign in to comment.