Skip to content

Commit c5f3d96

Browse files
committed
Set timeouts
1 parent 8375b3d commit c5f3d96

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/index.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ const getSupportsClientHints = ({ browser, browser_version }) => {
9696
);
9797
};
9898

99-
// 1080000 ms = 10 minutes
100-
const getDriverWithTimeout = (capabilitiesRaw, timeout = 1080000) =>
99+
// 300000 ms = 5 minutes
100+
const getDriverWithTimeout = (capabilitiesRaw, { timeout = 300000 } = {}) =>
101101
new Promise((resolve) => {
102102
// Clean up capabilities
103103
const capabilities = { ...capabilitiesRaw };
@@ -252,11 +252,14 @@ const getDeviceName = ({
252252
driverOptions["browserstack.timezone"] = "Amsterdam";
253253
}
254254

255-
let driver = await getDriverWithTimeout(driverOptions);
255+
let driver = await getDriverWithTimeout(driverOptions, {
256+
timeout: 180000,
257+
});
256258

257259
// Try again with new device when driver is not available
258260
if (typeof driver?.get !== "function") {
259-
driver = await getDriverWithTimeout(driverOptions);
261+
log(`Trying again`);
262+
driver = await getDriverWithTimeout(driverOptions, { timeout: 300000 });
260263

261264
// Device seems unavailable so this test will fail
262265
if (typeof driver?.get !== "function") {

0 commit comments

Comments
 (0)