Skip to content

Commit

Permalink
Pass the maxWorkers option on to node-haste
Browse files Browse the repository at this point in the history
Summary: Test runner options were not being passed to the loader. This changes `TestRunner` to pass the options and `HasteModuleLoader` to use the `maxWorkers` option value for node-haste's `maxProcesses` option.

I also submitted a CLA just now.
Closes jestjs#538

Reviewed By: @​svcscm

Differential Revision: D2545731

fb-gh-sync-id: 38584dadd444f21e65784fe84fbc32cc390eec94
  • Loading branch information
Jeremiah R. Hall authored and facebook-github-bot-2 committed Oct 15, 2015
1 parent 2f01b8d commit 8518d5b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/HasteModuleLoader/HasteModuleLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function _constructHasteInst(config, options) {
},
version: JSON.stringify(config),
useNativeFind: true,
maxProcesses: os.cpus().length,
maxProcesses: options.maxWorkers || os.cpus().length,
maxOpenFiles: options.maxOpenFiles || 100
}
);
Expand Down
4 changes: 2 additions & 2 deletions src/TestRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ class TestRunner {
if (this._moduleLoaderResourceMap === null) {
if (this._opts.useCachedModuleLoaderResourceMap) {
this._moduleLoaderResourceMap =
ModuleLoader.loadResourceMapFromCacheFile(this._config);
ModuleLoader.loadResourceMapFromCacheFile(this._config, this._opts);
} else {
this._moduleLoaderResourceMap =
ModuleLoader.loadResourceMap(this._config);
ModuleLoader.loadResourceMap(this._config, this._opts);
}
}
return this._moduleLoaderResourceMap;
Expand Down

0 comments on commit 8518d5b

Please sign in to comment.