Skip to content

Commit

Permalink
watch: decrease debounce rate
Browse files Browse the repository at this point in the history
PR-URL: #48926
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
  • Loading branch information
MoLow authored and targos committed Oct 28, 2023
1 parent 83a6d20 commit f27d505
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/internal/main/watch_mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const args = ArrayPrototypeFilter(process.execArgv, (arg, i, arr) =>
arg !== '--watch' && arg !== '--watch-preserve-output');
ArrayPrototypePushApply(args, kCommand);

const watcher = new FilesWatcher({ debounce: 500, mode: kShouldFilterModules ? 'filter' : 'all' });
const watcher = new FilesWatcher({ debounce: 200, mode: kShouldFilterModules ? 'filter' : 'all' });
ArrayPrototypeForEach(kWatchedPaths, (p) => watcher.watchPath(p));

let graceTimer;
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/test_runner/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ function runTestFile(path, root, inspectPort, filesWatcher, testNamePatterns) {
function watchFiles(testFiles, root, inspectPort, signal, testNamePatterns) {
const runningProcesses = new SafeMap();
const runningSubtests = new SafeMap();
const watcher = new FilesWatcher({ debounce: 500, mode: 'filter', signal });
const watcher = new FilesWatcher({ debounce: 200, mode: 'filter', signal });
const filesWatcher = { __proto__: null, watcher, runningProcesses, runningSubtests };

watcher.on('changed', ({ owners }) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/watch_mode/files_watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class FilesWatcher extends EventEmitter {
#mode;
#signal;

constructor({ debounce = 500, mode = 'filter', signal } = kEmptyObject) {
constructor({ debounce = 200, mode = 'filter', signal } = kEmptyObject) {
super();

validateNumber(debounce, 'options.debounce', 0, TIMEOUT_MAX);
Expand Down

0 comments on commit f27d505

Please sign in to comment.