Closed georgecrawford closed 8 years ago
Good catch. We should check the error message here to only run it twice when the future call breaks.
What kind of code would cause the future call to break?
Of you call Future.wait()
not within the same event loop where you call Fiber(...).run()
it breaks. This happens for instance when you do this:
browser.someCommand(); // works
process.nextTick(function() {
browser.someCommand(); // breaks
})
OK, I'll try that
As mentioned in https://github.com/webdriverio/wdio-sync/pull/12:
prints:
(two calls here: https://github.com/webdriverio/wdio-sync/blob/master/index.js#L60). Also note the stack trace isn't very useful here, and should be improved if possible.
An
async
custom function is similarly called twice:(first call here: https://github.com/webdriverio/wdio-sync/blob/master/index.js#L115, second call here: https://github.com/webdriverio/wdio-sync/blob/master/index.js#L143).
Whichever way we handle failures when calling a future, I don't think the custom function should be called twice - I think that's unexpected from a user's point of view.