{"action":"created","issue":{"url":"https://api.github.com/repos/sindresorhus/ava/issues/791","repository_url":"https://api.github.com/repos/sindresorhus/ava","labels_url":"https://api.github.com/repos/sindresorhus/ava/issues/791/labels{/name}","comments_url":"https://api.github.com/repos/sindresorhus/ava/issues/791/comments","events_url":"https://api.github.com/repos/sindresorhus/ava/issues/791/events","html_url":"https://github.com/sindresorhus/ava/pull/791","id":151239630,"number":791,"title":"Limited Process Pools","user":{"login":"dcousineau","id":30331,"avatar_url":"https://avatars.githubusercontent.com/u/30331?v=3","gravatar_id":"","url":"https://api.github.com/users/dcousineau","html_url":"https://github.com/dcousineau","followers_url":"https://api.github.com/users/dcousineau/followers","following_url":"https://api.github.com/users/dcousineau/following{/other_user}","gists_url":"https://api.github.com/users/dcousineau/gists{/gist_id}","starred_url":"https://api.github.com/users/dcousineau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcousineau/subscriptions","organizations_url":"https://api.github.com/users/dcousineau/orgs","repos_url":"https://api.github.com/users/dcousineau/repos","events_url":"https://api.github.com/users/dcousineau/events{/privacy}","received_events_url":"https://api.github.com/users/dcousineau/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":29,"created_at":"2016-04-26T21:09:23Z","updated_at":"2016-05-12T09:34:59Z","closed_at":"2016-05-12T09:32:45Z","pull_request":{"url":"https://api.github.com/repos/sindresorhus/ava/pulls/791","html_url":"https://github.com/sindresorhus/ava/pull/791","diff_url":"https://github.com/sindresorhus/ava/pull/791.diff","patch_url":"https://github.com/sindresorhus/ava/pull/791.patch"},"body":"Functionality to address #718.\r\n\r\n## Usage\r\n\r\n~~Running `ava --pool-size=5`~~ Running `ava --concurrency=5` will switch behavior to the limited process pool code (otherwise existing 'legacy' code will always run). ~~If `--serial` is defined the limited pool code is _not_ run.~~ If `--serial` is specified with a concurrency size, the concurrency size will be overridden and forced to 1.\r\n\r\n## Notes\r\n\r\nI encapsulated existing functionality and left it default. We cannot do the exclusive/`.only` with the limited pools as it requires us to have loaded and understand the entire test suite to make the decision about whether there is exclusivity to respect or not.\r\n\r\nAs a _beta_ feature using the process pool limit could come with the caveat that any features related to `.only` are disabled/ignored. For our use case the pool limiting is being used to keep memory usage under circleci's limits and ideally no `.only` tests make it into source control.\r\n\r\n### Easy Wins\r\n\r\nThe watcher worked right out of the box\r\n\r\n### ~~Things that make me nervous~~\r\n\r\n~~The error handling, particularly around `Couldn\\'t find any matching tests`, feels a bit like I'm stumbling in the dark, they work and I'm not 100% confident I know why.~~\r\n\r\n## Tests\r\n\r\nTesting was done initially by wrapping almost all `api.js` tests in a generator, and running them twice: once against the old behavior and once against the new behavior\r\n\r\n~~As a result **3 tests are currently failing.** This is because theres no real way to test exclusivity/deal with `.only`. These tests cannot pass until the fate of `.only` in relation to process pools is decided.~~\r\n\r\nTests related to `.only` functionality are not run against the new behavior.\r\n\r\n## Personal Opinions\r\n\r\nWhile ava could potentially statically analyze all the test files before entering in the process pool to look for exclusivity I'm concerned this is wasted effort that could be better spent deprecating .only and improving the filename globs.\r\n\r\nAlternatively .only could be scoped to be intended to only apply to the current running file (and not to the whole testsuite) which would eliminate any need for static analysis and if a developer wanted to run only a single file they could simply use filename glob matching on a case by case basis."},"comment":{"url":"https://api.github.com/repos/sindresorhus/ava/issues/comments/218707400","html_url":"https://github.com/sindresorhus/ava/pull/791#issuecomment-218707400","issue_url":"https://api.github.com/repos/sindresorhus/ava/issues/791","id":218707400,"user":{"login":"novemberborn","id":33538,"avatar_url":"https://avatars.githubusercontent.com/u/33538?v=3","gravatar_id":"","url":"https://api.github.com/users/novemberborn","html_url":"https://github.com/novemberborn","followers_url":"https://api.github.com/users/novemberborn/followers","following_url":"https://api.github.com/users/novemberborn/following{/other_user}","gists_url":"https://api.github.com/users/novemberborn/gists{/gist_id}","starred_url":"https://api.github.com/users/novemberborn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novemberborn/subscriptions","organizations_url":"https://api.github.com/users/novemberborn/orgs","repos_url":"https://api.github.com/users/novemberborn/repos","events_url":"https://api.github.com/users/novemberborn/events{/privacy}","received_events_url":"https://api.github.com/users/novemberborn/received_events","type":"User","site_admin":false},"created_at":"2016-05-12T09:34:59Z","updated_at":"2016-05-12T09:34:59Z","body":"![](http://i.giphy.com/rD0tbQKCxQURq.gif)"}}