Skip to content

Commit

Permalink
Merge branch 'master' into chore/package-lock
Browse files Browse the repository at this point in the history
  • Loading branch information
kfranqueiro committed Dec 14, 2018
2 parents 01790b6 + 30da021 commit db3c794
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
7 changes: 3 additions & 4 deletions test/screenshot/infra/lib/cli.js
Expand Up @@ -272,10 +272,9 @@ If a local dev server is not already running, one will be started for the durati
type: 'integer',
description: `
Maximum number of browser VMs to run in parallel (subject to our CBT plan limit and VM availability).
If no value is specified, the default is to start 2 browsers if nobody else is running tests, or 1 browser if other
tests are already running.
IMPORTANT: To ensure that multiple developers can run their tests simultaneously, DO NOT set this value during normal
business hours.
If no value is specified, the default behavior is to start half the number of available browsers.
IMPORTANT: To ensure that other developers can run their tests too, DO NOT override this value during
normal business hours.
`,
});

Expand Down
13 changes: 4 additions & 9 deletions test/screenshot/infra/lib/selenium-api.js
Expand Up @@ -395,17 +395,12 @@ class SeleniumApi {
}

if (this.isBusinessHours_()) {
// Nobody else is running tests.
if (active === 0) {
// Run half the number of concurrent tests allowed by our CBT account.
// This gives us _some_ parallelism while ensuring that other users can run their tests too.
return Math.floor(max / 2);
}

// Somebody else is running tests, so only run one test at a time.
return 1;
// Run half the number of concurrent tests allowed by our CBT account.
// This gives us _some_ parallelism while ensuring that other users can run their tests too.
return Math.floor(available / 2) || 1;
}

// Outside of normal business hours, we can be greedy and take up all available parallels.
return available;
}
}
Expand Down

0 comments on commit db3c794

Please sign in to comment.