Skip to content

Commit

Permalink
throw if attemptToCreateCommand() aborts by resolving to undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Jul 20, 2020
1 parent 8fcfc6f commit 88ca3ad
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/functional/services/remote/webdriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,13 @@ export async function initWebDriver(
),

Rx.race(
Rx.defer(() => attemptToCreateCommand(log, browserType, lifecycle, config)),
Rx.defer(async () => {
const command = await attemptToCreateCommand(log, browserType, lifecycle, config);
if (!command) {
throw new Error('remote creation aborted');
}
return command;
}),
Rx.timer(30 * SECOND).pipe(
map(() => {
throw new Error('remote failed to start within 30 seconds');
Expand Down

0 comments on commit 88ca3ad

Please sign in to comment.