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

Commit 33dcd77

Browse files
committed
fix(util): webdriver could deadlock
when prepare scripts containing promises are wrapped in a flow.execute
1 parent 4368842 commit 33dcd77

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lib/util.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
var q = require('q'),
2-
path = require('path'),
3-
webdriver = require('selenium-webdriver');
4-
2+
path = require('path');
3+
54
var STACK_SUBSTRINGS_TO_FILTER = [
65
'node_modules/minijasminenode/lib/',
76
'node_modules/selenium-webdriver',
@@ -52,9 +51,7 @@ exports.runFilenameOrFn_ = function(configDir, filenameOrFn, args) {
5251
filenameOrFn = require(path.resolve(configDir, filenameOrFn));
5352
}
5453
if (typeof filenameOrFn === 'function') {
55-
var results = webdriver.promise.controlFlow().execute(function() {
56-
return filenameOrFn.apply(null, args);
57-
}, 'executing onPrepare').then(null, function(err) {
54+
var results = q.when(filenameOrFn.apply(null, args), null, function(err) {
5855
err.stack = exports.filterStackTrace(err.stack);
5956
throw err;
6057
});

0 commit comments

Comments
 (0)