@theia/filesystem 1.72.1 → 1.72.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/node/parcel-watcher/parcel-filesystem-service.d.ts +8 -0
- package/lib/node/parcel-watcher/parcel-filesystem-service.d.ts.map +1 -1
- package/lib/node/parcel-watcher/parcel-filesystem-service.js +38 -2
- package/lib/node/parcel-watcher/parcel-filesystem-service.js.map +1 -1
- package/lib/node/parcel-watcher/parcel-watcher-exclude.spec.d.ts +2 -0
- package/lib/node/parcel-watcher/parcel-watcher-exclude.spec.d.ts.map +1 -0
- package/lib/node/parcel-watcher/parcel-watcher-exclude.spec.js +79 -0
- package/lib/node/parcel-watcher/parcel-watcher-exclude.spec.js.map +1 -0
- package/lib/node/parcel-watcher/parcel-watcher-retry.spec.d.ts +2 -0
- package/lib/node/parcel-watcher/parcel-watcher-retry.spec.d.ts.map +1 -0
- package/lib/node/parcel-watcher/parcel-watcher-retry.spec.js +102 -0
- package/lib/node/parcel-watcher/parcel-watcher-retry.spec.js.map +1 -0
- package/package.json +4 -4
- package/src/node/parcel-watcher/parcel-filesystem-service.ts +45 -2
- package/src/node/parcel-watcher/parcel-watcher-exclude.spec.ts +91 -0
- package/src/node/parcel-watcher/parcel-watcher-retry.spec.ts +117 -0
|
@@ -4,7 +4,15 @@ import { FileChangeCollection } from '../file-change-collection';
|
|
|
4
4
|
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
5
5
|
import { Options, AsyncSubscription, Event } from '@theia/core/shared/@parcel/watcher';
|
|
6
6
|
export interface ParcelWatcherOptions {
|
|
7
|
+
/** Compiled exclude patterns, used to filter events after they arrive. */
|
|
7
8
|
ignored: Minimatch[];
|
|
9
|
+
/**
|
|
10
|
+
* Raw exclude patterns, passed to the native parcel `ignore` option so that excluded
|
|
11
|
+
* directories are never crawled or watched in the first place (rather than only having
|
|
12
|
+
* their events filtered out afterwards). This is what actually keeps the number of OS
|
|
13
|
+
* file watches (e.g. inotify watches on Linux) bounded on large workspaces.
|
|
14
|
+
*/
|
|
15
|
+
ignorePatterns: string[];
|
|
8
16
|
}
|
|
9
17
|
export declare const ParcelFileSystemWatcherServerOptions: unique symbol;
|
|
10
18
|
export interface ParcelFileSystemWatcherServerOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parcel-filesystem-service.d.ts","sourceRoot":"","sources":["../../../src/node/parcel-watcher/parcel-filesystem-service.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EACH,cAAc,EAAE,wBAAwB,EAAE,8BAA8B,EAAE,YAAY,EACzF,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAW,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAa,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,oCAAoC,CAAC;AAGlG,MAAM,WAAW,oBAAoB;IACjC,OAAO,EAAE,SAAS,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"parcel-filesystem-service.d.ts","sourceRoot":"","sources":["../../../src/node/parcel-watcher/parcel-filesystem-service.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EACH,cAAc,EAAE,wBAAwB,EAAE,8BAA8B,EAAE,YAAY,EACzF,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAW,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAa,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,oCAAoC,CAAC;AAGlG,MAAM,WAAW,oBAAoB;IACjC,0EAA0E;IAC1E,OAAO,EAAE,SAAS,EAAE,CAAA;IACpB;;;;;OAKG;IACH,cAAc,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O,EAAE,YAAY,GAAG,aAAa;IASzF,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAU1D;;OAEG;IACH,SAAS,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,MAAM;IAOnE;;OAEG;IACH,SAAS,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,YAAY;IAQnE,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI;IAMxD,OAAO,IAAI,IAAI;CAGlB"}
|
|
@@ -92,6 +92,7 @@ class ParcelWatcher {
|
|
|
92
92
|
if (error === exports.WatcherDisposal) {
|
|
93
93
|
return false;
|
|
94
94
|
}
|
|
95
|
+
console.error(`Watcher failed to start at "${this.fsPath}":`, error);
|
|
95
96
|
this._dispose();
|
|
96
97
|
this.fireError();
|
|
97
98
|
throw error;
|
|
@@ -173,7 +174,34 @@ class ParcelWatcher {
|
|
|
173
174
|
this.assertNotDisposed();
|
|
174
175
|
}
|
|
175
176
|
this.assertNotDisposed();
|
|
176
|
-
|
|
177
|
+
// This race is specific to Linux/inotify: parcel-watcher's inotify backend walks
|
|
178
|
+
// the tree and then calls inotify_add_watch on every subdirectory. If a subdirectory
|
|
179
|
+
// disappears between the walk and the add (common when watching dirs that contain
|
|
180
|
+
// auto-rotated log/temp folders), the syscall returns ENOENT and parcel-watcher fails
|
|
181
|
+
// the entire subscribe. Retry a few times: by the next walk the gone-but-not-forgotten
|
|
182
|
+
// dir is no longer present. Windows (ReadDirectoryChangesW) and macOS (FSEvents) watch
|
|
183
|
+
// the whole subtree from a single handle on the root and never register per-subdirectory
|
|
184
|
+
// watches, so they cannot hit this race; the retry is simply a no-op there.
|
|
185
|
+
let watcher;
|
|
186
|
+
let attempt = 0;
|
|
187
|
+
while (true) {
|
|
188
|
+
try {
|
|
189
|
+
watcher = await this.createWatcher();
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
const message = (error && error.message) || '';
|
|
194
|
+
const isTransientEnoent = message.includes('No such file or directory')
|
|
195
|
+
&& await fs_1.promises.stat(this.fsPath).then(() => true, () => false);
|
|
196
|
+
if (!isTransientEnoent || attempt >= 4) {
|
|
197
|
+
throw error;
|
|
198
|
+
}
|
|
199
|
+
attempt++;
|
|
200
|
+
this.assertNotDisposed();
|
|
201
|
+
await (0, promise_util_1.timeout)(100 * attempt);
|
|
202
|
+
this.assertNotDisposed();
|
|
203
|
+
}
|
|
204
|
+
}
|
|
177
205
|
this.assertNotDisposed();
|
|
178
206
|
this.debug('STARTED', `disposed=${this.disposed}`);
|
|
179
207
|
// The watcher could be disposed while it was starting, make sure to check for this:
|
|
@@ -213,7 +241,14 @@ class ParcelWatcher {
|
|
|
213
241
|
}
|
|
214
242
|
}, {
|
|
215
243
|
backend: ParcelWatcher.PARCEL_WATCHER_BACKEND,
|
|
216
|
-
...this.parcelFileSystemWatchServerOptions.parcelOptions
|
|
244
|
+
...this.parcelFileSystemWatchServerOptions.parcelOptions,
|
|
245
|
+
// Pass the excludes to parcel's native `ignore` so excluded directories are pruned
|
|
246
|
+
// from the watch tree (no OS watch is placed), not merely filtered out of the event
|
|
247
|
+
// stream. Mirrors VS Code's parcel watcher (`ignore: <request excludes>`).
|
|
248
|
+
ignore: [
|
|
249
|
+
...(this.parcelFileSystemWatchServerOptions.parcelOptions.ignore ?? []),
|
|
250
|
+
...this.watcherOptions.ignorePatterns
|
|
251
|
+
]
|
|
217
252
|
});
|
|
218
253
|
}
|
|
219
254
|
handleWatcherEvents(events) {
|
|
@@ -361,6 +396,7 @@ class ParcelFileSystemWatcherService {
|
|
|
361
396
|
const watcherOptions = {
|
|
362
397
|
ignored: options.ignored
|
|
363
398
|
.map(pattern => new minimatch_1.Minimatch(pattern, { dot: true })),
|
|
399
|
+
ignorePatterns: options.ignored,
|
|
364
400
|
};
|
|
365
401
|
return new ParcelWatcher(clientId, fsPath, watcherOptions, this.options, this.maybeClient);
|
|
366
402
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parcel-filesystem-service.js","sourceRoot":"","sources":["../../../src/node/parcel-watcher/parcel-filesystem-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,8CAA8C;AAC9C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAEhF,6BAA8B;AAC9B,2BAAqC;AACrC,yCAAsC;AACtC,8DAA0D;AAI1D,sEAAiE;AACjE,sEAAwE;AACxE,gEAAkG;AAClG,sCAA+C;AAMlC,QAAA,oCAAoC,GAAG,MAAM,CAAC,sCAAsC,CAAC,CAAC;AAUnG;;GAEG;AACU,QAAA,eAAe,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAEzD;;;;;;;;;GASG;AACH,MAAa,aAAa;aAEL,oBAAe,GAAG,CAAC,AAAJ,CAAK;IAqDrC,gKAAgK;aACxI,2BAAsB,GAAG,gBAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAK,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,AAA1D,CAA2D;IAEzG;IACI,wCAAwC;IACxC,eAAuB;IACvB,qCAAqC;IAC5B,MAAc;IACvB,+BAA+B;IACtB,cAAoC;IAC7C,yCAAyC;IACtB,kCAAwE;IAC3F,uCAAuC;IACpB,uBAAuD;IAC1E,+EAA+E;IAC5D,0BAA0B,MAAM;QAR1C,WAAM,GAAN,MAAM,CAAQ;QAEd,mBAAc,GAAd,cAAc,CAAsB;QAE1B,uCAAkC,GAAlC,kCAAkC,CAAsC;QAExE,4BAAuB,GAAvB,uBAAuB,CAAgC;QAEvD,4B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AAO,EAAE,EAAE;YACX,GAAG,OAAO;SACb,CAAC;IACN,CAAC;IAED,8DAA8D;IACpD,KAAK,CAAC,OAAe,EAAE,GAAG,MAAa;QAC7C,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;YACvB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC;QAC1C,CAAC;IACL,CAAC;IAED,OAAO;QACH,sCAAsC;IAC1C,CAAC;CACJ;AAvGD,wEAuGC"}
|
|
1
|
+
{"version":3,"file":"parcel-filesystem-service.js","sourceRoot":"","sources":["../../../src/node/parcel-watcher/parcel-filesystem-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,8CAA8C;AAC9C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAEhF,6BAA8B;AAC9B,2BAAqC;AACrC,yCAAsC;AACtC,8DAA0D;AAI1D,sEAAiE;AACjE,sEAAwE;AACxE,gEAAkG;AAClG,sCAA+C;AAclC,QAAA,oCAAoC,GAAG,MAAM,CAAC,sCAAsC,CAAC,CAAC;AAUnG;;GAEG;AACU,QAAA,eAAe,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAEzD;;;;;;;;;GASG;AACH,MAAa,aAAa;aAEL,oBAAe,GAAG,CAAC,AAAJ,CAAK;IAqDrC,gKAAgK;aACxI,2BAAsB,GAAG,gBAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAK,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,AAA1D,CAA2D;IAEzG;IACI,wCAAwC;IACxC,eAAuB;IACvB,qCAAqC;IAC5B,MAAc;IACvB,+BAA+B;IACtB,cAAoC;IAC7C,yCAAyC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,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAE,wDAAwD;SACnG,CAAC,IAAI,EAAE,CAAC;IACb,CAAC;IAED;;OAEG;IACO,mBAAmB,CAAC,OAAsB;QAChD,OAAO;YACH,OAAO,EAAE,EAAE;YACX,GAAG,OAAO;SACb,CAAC;IACN,CAAC;IAED,8DAA8D;IACpD,KAAK,CAAC,OAAe,EAAE,GAAG,MAAa;QAC7C,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;YACvB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC;QAC1C,CAAC;IACL,CAAC;IAED,OAAO;QACH,sCAAsC;IAC1C,CAAC;CACJ;AAxGD,wEAwGC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parcel-watcher-exclude.spec.d.ts","sourceRoot":"","sources":["../../../src/node/parcel-watcher/parcel-watcher-exclude.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2026 Safi Seid-Ahmad, K2view and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const chai = require("chai");
|
|
19
|
+
const sinon = require("sinon");
|
|
20
|
+
const temp = require("temp");
|
|
21
|
+
const fs = require("@theia/core/shared/fs-extra");
|
|
22
|
+
const node_1 = require("@theia/core/lib/node");
|
|
23
|
+
const parcel_filesystem_service_1 = require("./parcel-filesystem-service");
|
|
24
|
+
// We require the *same* module object that the production code imports from, so that
|
|
25
|
+
// stubbing its `subscribe` export is observed by `ParcelWatcher`. The `@theia/core/shared`
|
|
26
|
+
// shim simply re-exports `require('@parcel/watcher')`, so this is the identical reference.
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
28
|
+
const parcel = require('@theia/core/shared/@parcel/watcher');
|
|
29
|
+
const expect = chai.expect;
|
|
30
|
+
const track = temp.track();
|
|
31
|
+
/**
|
|
32
|
+
* Reproduces the `files.watcherExclude` / exclude leak:
|
|
33
|
+
*
|
|
34
|
+
* Excludes flow `files.watcherExclude` -> `WatchOptions.excludes`
|
|
35
|
+
* -> `disk-file-system-provider` (`{ ignored }`) -> `ParcelWatcherOptions.ignored`.
|
|
36
|
+
* However `ParcelWatcher.createWatcher()` only uses `ignored` to *filter events after they
|
|
37
|
+
* arrive* (`isIgnored`/`pushFileChange`). It never passes them to the native `@parcel/watcher`
|
|
38
|
+
* `subscribe(..., { ignore })` option, so excluded directories are STILL crawled and given
|
|
39
|
+
* inotify watches. On large workspaces this exhausts `fs.inotify.max_user_watches`
|
|
40
|
+
* ("Unable to watch for file changes in this large workspace.") even though the user
|
|
41
|
+
* configured excludes that should have pruned those directories.
|
|
42
|
+
*/
|
|
43
|
+
describe('parcel-filesystem-watcher exclude handling', function () {
|
|
44
|
+
this.timeout(20000);
|
|
45
|
+
let root;
|
|
46
|
+
let service;
|
|
47
|
+
let subscribeStub;
|
|
48
|
+
let capturedOptions;
|
|
49
|
+
beforeEach(() => {
|
|
50
|
+
const tempPath = temp.mkdirSync('parcel-exclude-root');
|
|
51
|
+
root = node_1.FileUri.create(fs.realpathSync(tempPath));
|
|
52
|
+
capturedOptions = [];
|
|
53
|
+
// Stub the native parcel `subscribe` so we can inspect the options Theia passes to it
|
|
54
|
+
// (and so the test does not place real OS watches).
|
|
55
|
+
subscribeStub = sinon.stub(parcel, 'subscribe').callsFake(
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
57
|
+
async (_dir, _cb, opts) => {
|
|
58
|
+
capturedOptions.push(opts);
|
|
59
|
+
return { unsubscribe: async () => undefined };
|
|
60
|
+
});
|
|
61
|
+
service = new parcel_filesystem_service_1.ParcelFileSystemWatcherService({ verbose: false });
|
|
62
|
+
});
|
|
63
|
+
afterEach(() => {
|
|
64
|
+
subscribeStub.restore();
|
|
65
|
+
service.dispose();
|
|
66
|
+
track.cleanupSync();
|
|
67
|
+
});
|
|
68
|
+
it('passes the configured excludes to the native parcel `ignore` option so excluded directories are not watched', async () => {
|
|
69
|
+
const excludePattern = '**/node_modules/**';
|
|
70
|
+
await service.watchFileChanges(0, root.toString(), { ignored: [excludePattern] });
|
|
71
|
+
// Allow ParcelWatcher.start() (stat + subscribe) to run.
|
|
72
|
+
await new Promise(resolve => setTimeout(resolve, 300));
|
|
73
|
+
expect(subscribeStub.called, 'native parcel subscribe should have been called').to.equal(true);
|
|
74
|
+
const opts = capturedOptions[0] ?? {};
|
|
75
|
+
expect(opts.ignore, 'parcel subscribe options should carry an `ignore` list built from the excludes').to.not.equal(undefined);
|
|
76
|
+
expect(opts.ignore, 'the configured exclude pattern should be passed to parcel `ignore`').to.include(excludePattern);
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
//# sourceMappingURL=parcel-watcher-exclude.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parcel-watcher-exclude.spec.js","sourceRoot":"","sources":["../../../src/node/parcel-watcher/parcel-watcher-exclude.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yDAAyD;AACzD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0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2026 EclipseSource and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const chai = require("chai");
|
|
19
|
+
const sinon = require("sinon");
|
|
20
|
+
const temp = require("temp");
|
|
21
|
+
const fs = require("@theia/core/shared/fs-extra");
|
|
22
|
+
const node_1 = require("@theia/core/lib/node");
|
|
23
|
+
const parcel_filesystem_service_1 = require("./parcel-filesystem-service");
|
|
24
|
+
// We require the *same* module object that the production code imports from, so that
|
|
25
|
+
// stubbing its `subscribe` export is observed by `ParcelWatcher`. The `@theia/core/shared`
|
|
26
|
+
// shim simply re-exports `require('@parcel/watcher')`, so this is the identical reference.
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
28
|
+
const parcel = require('@theia/core/shared/@parcel/watcher');
|
|
29
|
+
const expect = chai.expect;
|
|
30
|
+
const track = temp.track();
|
|
31
|
+
/**
|
|
32
|
+
* Covers the inotify-tree-race fix in `ParcelWatcher.start()`:
|
|
33
|
+
*
|
|
34
|
+
* parcel-watcher walks the directory tree and only then calls `inotify_add_watch`
|
|
35
|
+
* on each subdirectory. If a subdirectory disappears between the walk and the add
|
|
36
|
+
* (common when watching dirs that contain rotated logs/temp folders), the syscall
|
|
37
|
+
* returns ENOENT and parcel-watcher fails the *entire* subscribe. The fix retries
|
|
38
|
+
* `createWatcher` a few times, but only when (a) the underlying error indicates a
|
|
39
|
+
* missing path and (b) the watched root itself still exists.
|
|
40
|
+
*/
|
|
41
|
+
describe('parcel-filesystem-watcher transient ENOENT handling', function () {
|
|
42
|
+
this.timeout(20000);
|
|
43
|
+
let root;
|
|
44
|
+
let service;
|
|
45
|
+
let subscribeStub;
|
|
46
|
+
let consoleErrorStub;
|
|
47
|
+
let onError;
|
|
48
|
+
beforeEach(() => {
|
|
49
|
+
const tempPath = temp.mkdirSync('parcel-enoent-root');
|
|
50
|
+
root = node_1.FileUri.create(fs.realpathSync(tempPath));
|
|
51
|
+
// start() now logs the underlying error to stderr on failure; silence it
|
|
52
|
+
// so the test output stays readable.
|
|
53
|
+
consoleErrorStub = sinon.stub(console, 'error');
|
|
54
|
+
service = new parcel_filesystem_service_1.ParcelFileSystemWatcherService({ verbose: false });
|
|
55
|
+
onError = sinon.stub();
|
|
56
|
+
service.setClient({
|
|
57
|
+
onDidFilesChanged: () => undefined,
|
|
58
|
+
onError,
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
afterEach(() => {
|
|
62
|
+
subscribeStub?.restore();
|
|
63
|
+
consoleErrorStub.restore();
|
|
64
|
+
track.cleanupSync();
|
|
65
|
+
});
|
|
66
|
+
it('retries when subscribe throws a transient ENOENT and the watched root still exists', async () => {
|
|
67
|
+
let attempts = 0;
|
|
68
|
+
subscribeStub = sinon.stub(parcel, 'subscribe').callsFake(async () => {
|
|
69
|
+
attempts++;
|
|
70
|
+
if (attempts < 3) {
|
|
71
|
+
throw new Error('No such file or directory at /tmp/rotated-log');
|
|
72
|
+
}
|
|
73
|
+
return { unsubscribe: async () => undefined };
|
|
74
|
+
});
|
|
75
|
+
await service.watchFileChanges(0, root.toString());
|
|
76
|
+
// Backoff schedule for two retries: 100 + 200 = 300ms. Leave generous margin.
|
|
77
|
+
await new Promise(resolve => setTimeout(resolve, 800));
|
|
78
|
+
expect(attempts, 'subscribe should have been retried until it succeeded').to.equal(3);
|
|
79
|
+
expect(onError.called, 'no error should surface to the client once the retry recovered').to.equal(false);
|
|
80
|
+
});
|
|
81
|
+
it('does not retry on non-ENOENT errors and surfaces the failure immediately', async () => {
|
|
82
|
+
subscribeStub = sinon.stub(parcel, 'subscribe').callsFake(async () => {
|
|
83
|
+
throw new Error('EACCES: permission denied');
|
|
84
|
+
});
|
|
85
|
+
await service.watchFileChanges(0, root.toString());
|
|
86
|
+
await new Promise(resolve => setTimeout(resolve, 200));
|
|
87
|
+
expect(subscribeStub.callCount, 'non-transient errors must not trigger any retry').to.equal(1);
|
|
88
|
+
expect(onError.called, 'error must be reported to the client').to.equal(true);
|
|
89
|
+
});
|
|
90
|
+
it('gives up after the retry budget is exhausted on persistent ENOENT', async () => {
|
|
91
|
+
subscribeStub = sinon.stub(parcel, 'subscribe').callsFake(async () => {
|
|
92
|
+
throw new Error('No such file or directory at /tmp/rotated-log');
|
|
93
|
+
});
|
|
94
|
+
await service.watchFileChanges(0, root.toString());
|
|
95
|
+
// Total backoff is 100+200+300+400 = 1000ms; leave a margin for scheduling.
|
|
96
|
+
await new Promise(resolve => setTimeout(resolve, 1700));
|
|
97
|
+
// Initial attempt + 4 retries = 5 total subscribe calls.
|
|
98
|
+
expect(subscribeStub.callCount, 'should retry up to the budget then give up').to.equal(5);
|
|
99
|
+
expect(onError.called, 'error must surface once the retry budget is exhausted').to.equal(true);
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
//# sourceMappingURL=parcel-watcher-retry.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parcel-watcher-retry.spec.js","sourceRoot":"","sources":["../../../src/node/parcel-watcher/parcel-watcher-retry.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2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2
2
|
"name": "@theia/filesystem",
|
|
3
|
-
"version": "1.72.
|
|
3
|
+
"version": "1.72.3",
|
|
4
4
|
"description": "Theia - FileSystem Extension",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/core": "1.72.
|
|
6
|
+
"@theia/core": "1.72.3",
|
|
7
7
|
"@types/body-parser": "^1.19.6",
|
|
8
8
|
"@types/multer": "^1.4.13",
|
|
9
9
|
"@types/tar-fs": "^1.16.3",
|
|
@@ -77,10 +77,10 @@
|
|
|
77
77
|
"watch": "theiaext watch"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"@theia/ext-scripts": "1.72.
|
|
80
|
+
"@theia/ext-scripts": "1.72.3"
|
|
81
81
|
},
|
|
82
82
|
"nyc": {
|
|
83
83
|
"extends": "../../configs/nyc.json"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "006945cdc227f743d0308704c27e259ed677d64f"
|
|
86
86
|
}
|
|
@@ -27,7 +27,15 @@ import { subscribe, Options, AsyncSubscription, Event } from '@theia/core/shared
|
|
|
27
27
|
import { isOSX, isWindows } from '@theia/core';
|
|
28
28
|
|
|
29
29
|
export interface ParcelWatcherOptions {
|
|
30
|
+
/** Compiled exclude patterns, used to filter events after they arrive. */
|
|
30
31
|
ignored: Minimatch[]
|
|
32
|
+
/**
|
|
33
|
+
* Raw exclude patterns, passed to the native parcel `ignore` option so that excluded
|
|
34
|
+
* directories are never crawled or watched in the first place (rather than only having
|
|
35
|
+
* their events filtered out afterwards). This is what actually keeps the number of OS
|
|
36
|
+
* file watches (e.g. inotify watches on Linux) bounded on large workspaces.
|
|
37
|
+
*/
|
|
38
|
+
ignorePatterns: string[]
|
|
31
39
|
}
|
|
32
40
|
|
|
33
41
|
export const ParcelFileSystemWatcherServerOptions = Symbol('ParcelFileSystemWatcherServerOptions');
|
|
@@ -132,6 +140,7 @@ export class ParcelWatcher {
|
|
|
132
140
|
if (error === WatcherDisposal) {
|
|
133
141
|
return false;
|
|
134
142
|
}
|
|
143
|
+
console.error(`Watcher failed to start at "${this.fsPath}":`, error);
|
|
135
144
|
this._dispose();
|
|
136
145
|
this.fireError();
|
|
137
146
|
throw error;
|
|
@@ -219,7 +228,33 @@ export class ParcelWatcher {
|
|
|
219
228
|
this.assertNotDisposed();
|
|
220
229
|
}
|
|
221
230
|
this.assertNotDisposed();
|
|
222
|
-
|
|
231
|
+
// This race is specific to Linux/inotify: parcel-watcher's inotify backend walks
|
|
232
|
+
// the tree and then calls inotify_add_watch on every subdirectory. If a subdirectory
|
|
233
|
+
// disappears between the walk and the add (common when watching dirs that contain
|
|
234
|
+
// auto-rotated log/temp folders), the syscall returns ENOENT and parcel-watcher fails
|
|
235
|
+
// the entire subscribe. Retry a few times: by the next walk the gone-but-not-forgotten
|
|
236
|
+
// dir is no longer present. Windows (ReadDirectoryChangesW) and macOS (FSEvents) watch
|
|
237
|
+
// the whole subtree from a single handle on the root and never register per-subdirectory
|
|
238
|
+
// watches, so they cannot hit this race; the retry is simply a no-op there.
|
|
239
|
+
let watcher: AsyncSubscription | undefined;
|
|
240
|
+
let attempt = 0;
|
|
241
|
+
while (true) {
|
|
242
|
+
try {
|
|
243
|
+
watcher = await this.createWatcher();
|
|
244
|
+
break;
|
|
245
|
+
} catch (error) {
|
|
246
|
+
const message: string = (error && error.message) || '';
|
|
247
|
+
const isTransientEnoent = message.includes('No such file or directory')
|
|
248
|
+
&& await fsp.stat(this.fsPath).then(() => true, () => false);
|
|
249
|
+
if (!isTransientEnoent || attempt >= 4) {
|
|
250
|
+
throw error;
|
|
251
|
+
}
|
|
252
|
+
attempt++;
|
|
253
|
+
this.assertNotDisposed();
|
|
254
|
+
await timeout(100 * attempt);
|
|
255
|
+
this.assertNotDisposed();
|
|
256
|
+
}
|
|
257
|
+
}
|
|
223
258
|
this.assertNotDisposed();
|
|
224
259
|
this.debug('STARTED', `disposed=${this.disposed}`);
|
|
225
260
|
// The watcher could be disposed while it was starting, make sure to check for this:
|
|
@@ -260,7 +295,14 @@ export class ParcelWatcher {
|
|
|
260
295
|
}
|
|
261
296
|
}, {
|
|
262
297
|
backend: ParcelWatcher.PARCEL_WATCHER_BACKEND,
|
|
263
|
-
...this.parcelFileSystemWatchServerOptions.parcelOptions
|
|
298
|
+
...this.parcelFileSystemWatchServerOptions.parcelOptions,
|
|
299
|
+
// Pass the excludes to parcel's native `ignore` so excluded directories are pruned
|
|
300
|
+
// from the watch tree (no OS watch is placed), not merely filtered out of the event
|
|
301
|
+
// stream. Mirrors VS Code's parcel watcher (`ignore: <request excludes>`).
|
|
302
|
+
ignore: [
|
|
303
|
+
...(this.parcelFileSystemWatchServerOptions.parcelOptions.ignore ?? []),
|
|
304
|
+
...this.watcherOptions.ignorePatterns
|
|
305
|
+
]
|
|
264
306
|
});
|
|
265
307
|
}
|
|
266
308
|
|
|
@@ -435,6 +477,7 @@ export class ParcelFileSystemWatcherService implements FileSystemWatcherService
|
|
|
435
477
|
const watcherOptions: ParcelWatcherOptions = {
|
|
436
478
|
ignored: options.ignored
|
|
437
479
|
.map(pattern => new Minimatch(pattern, { dot: true })),
|
|
480
|
+
ignorePatterns: options.ignored,
|
|
438
481
|
};
|
|
439
482
|
return new ParcelWatcher(clientId, fsPath, watcherOptions, this.options, this.maybeClient);
|
|
440
483
|
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2026 Safi Seid-Ahmad, K2view and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import * as chai from 'chai';
|
|
18
|
+
import * as sinon from 'sinon';
|
|
19
|
+
import * as temp from 'temp';
|
|
20
|
+
import * as fs from '@theia/core/shared/fs-extra';
|
|
21
|
+
import URI from '@theia/core/lib/common/uri';
|
|
22
|
+
import { FileUri } from '@theia/core/lib/node';
|
|
23
|
+
import { Options } from '@theia/core/shared/@parcel/watcher';
|
|
24
|
+
import { ParcelFileSystemWatcherService } from './parcel-filesystem-service';
|
|
25
|
+
|
|
26
|
+
// We require the *same* module object that the production code imports from, so that
|
|
27
|
+
// stubbing its `subscribe` export is observed by `ParcelWatcher`. The `@theia/core/shared`
|
|
28
|
+
// shim simply re-exports `require('@parcel/watcher')`, so this is the identical reference.
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
30
|
+
const parcel = require('@theia/core/shared/@parcel/watcher');
|
|
31
|
+
|
|
32
|
+
const expect = chai.expect;
|
|
33
|
+
const track = temp.track();
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Reproduces the `files.watcherExclude` / exclude leak:
|
|
37
|
+
*
|
|
38
|
+
* Excludes flow `files.watcherExclude` -> `WatchOptions.excludes`
|
|
39
|
+
* -> `disk-file-system-provider` (`{ ignored }`) -> `ParcelWatcherOptions.ignored`.
|
|
40
|
+
* However `ParcelWatcher.createWatcher()` only uses `ignored` to *filter events after they
|
|
41
|
+
* arrive* (`isIgnored`/`pushFileChange`). It never passes them to the native `@parcel/watcher`
|
|
42
|
+
* `subscribe(..., { ignore })` option, so excluded directories are STILL crawled and given
|
|
43
|
+
* inotify watches. On large workspaces this exhausts `fs.inotify.max_user_watches`
|
|
44
|
+
* ("Unable to watch for file changes in this large workspace.") even though the user
|
|
45
|
+
* configured excludes that should have pruned those directories.
|
|
46
|
+
*/
|
|
47
|
+
describe('parcel-filesystem-watcher exclude handling', function (): void {
|
|
48
|
+
|
|
49
|
+
this.timeout(20000);
|
|
50
|
+
|
|
51
|
+
let root: URI;
|
|
52
|
+
let service: ParcelFileSystemWatcherService;
|
|
53
|
+
let subscribeStub: sinon.SinonStub;
|
|
54
|
+
let capturedOptions: Options[];
|
|
55
|
+
|
|
56
|
+
beforeEach(() => {
|
|
57
|
+
const tempPath = temp.mkdirSync('parcel-exclude-root');
|
|
58
|
+
root = FileUri.create(fs.realpathSync(tempPath));
|
|
59
|
+
capturedOptions = [];
|
|
60
|
+
// Stub the native parcel `subscribe` so we can inspect the options Theia passes to it
|
|
61
|
+
// (and so the test does not place real OS watches).
|
|
62
|
+
subscribeStub = sinon.stub(parcel, 'subscribe').callsFake(
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
64
|
+
async (_dir: string, _cb: any, opts: Options) => {
|
|
65
|
+
capturedOptions.push(opts);
|
|
66
|
+
return { unsubscribe: async () => undefined };
|
|
67
|
+
});
|
|
68
|
+
service = new ParcelFileSystemWatcherService({ verbose: false });
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
afterEach(() => {
|
|
72
|
+
subscribeStub.restore();
|
|
73
|
+
service.dispose();
|
|
74
|
+
track.cleanupSync();
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('passes the configured excludes to the native parcel `ignore` option so excluded directories are not watched', async () => {
|
|
78
|
+
const excludePattern = '**/node_modules/**';
|
|
79
|
+
|
|
80
|
+
await service.watchFileChanges(0, root.toString(), { ignored: [excludePattern] });
|
|
81
|
+
// Allow ParcelWatcher.start() (stat + subscribe) to run.
|
|
82
|
+
await new Promise(resolve => setTimeout(resolve, 300));
|
|
83
|
+
|
|
84
|
+
expect(subscribeStub.called, 'native parcel subscribe should have been called').to.equal(true);
|
|
85
|
+
|
|
86
|
+
const opts = capturedOptions[0] ?? {};
|
|
87
|
+
expect(opts.ignore, 'parcel subscribe options should carry an `ignore` list built from the excludes').to.not.equal(undefined);
|
|
88
|
+
expect(opts.ignore, 'the configured exclude pattern should be passed to parcel `ignore`').to.include(excludePattern);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
});
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2026 EclipseSource and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import * as chai from 'chai';
|
|
18
|
+
import * as sinon from 'sinon';
|
|
19
|
+
import * as temp from 'temp';
|
|
20
|
+
import * as fs from '@theia/core/shared/fs-extra';
|
|
21
|
+
import URI from '@theia/core/lib/common/uri';
|
|
22
|
+
import { FileUri } from '@theia/core/lib/node';
|
|
23
|
+
import { ParcelFileSystemWatcherService } from './parcel-filesystem-service';
|
|
24
|
+
|
|
25
|
+
// We require the *same* module object that the production code imports from, so that
|
|
26
|
+
// stubbing its `subscribe` export is observed by `ParcelWatcher`. The `@theia/core/shared`
|
|
27
|
+
// shim simply re-exports `require('@parcel/watcher')`, so this is the identical reference.
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
29
|
+
const parcel = require('@theia/core/shared/@parcel/watcher');
|
|
30
|
+
|
|
31
|
+
const expect = chai.expect;
|
|
32
|
+
const track = temp.track();
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Covers the inotify-tree-race fix in `ParcelWatcher.start()`:
|
|
36
|
+
*
|
|
37
|
+
* parcel-watcher walks the directory tree and only then calls `inotify_add_watch`
|
|
38
|
+
* on each subdirectory. If a subdirectory disappears between the walk and the add
|
|
39
|
+
* (common when watching dirs that contain rotated logs/temp folders), the syscall
|
|
40
|
+
* returns ENOENT and parcel-watcher fails the *entire* subscribe. The fix retries
|
|
41
|
+
* `createWatcher` a few times, but only when (a) the underlying error indicates a
|
|
42
|
+
* missing path and (b) the watched root itself still exists.
|
|
43
|
+
*/
|
|
44
|
+
describe('parcel-filesystem-watcher transient ENOENT handling', function (): void {
|
|
45
|
+
|
|
46
|
+
this.timeout(20000);
|
|
47
|
+
|
|
48
|
+
let root: URI;
|
|
49
|
+
let service: ParcelFileSystemWatcherService;
|
|
50
|
+
let subscribeStub: sinon.SinonStub | undefined;
|
|
51
|
+
let consoleErrorStub: sinon.SinonStub;
|
|
52
|
+
let onError: sinon.SinonStub;
|
|
53
|
+
|
|
54
|
+
beforeEach(() => {
|
|
55
|
+
const tempPath = temp.mkdirSync('parcel-enoent-root');
|
|
56
|
+
root = FileUri.create(fs.realpathSync(tempPath));
|
|
57
|
+
// start() now logs the underlying error to stderr on failure; silence it
|
|
58
|
+
// so the test output stays readable.
|
|
59
|
+
consoleErrorStub = sinon.stub(console, 'error');
|
|
60
|
+
service = new ParcelFileSystemWatcherService({ verbose: false });
|
|
61
|
+
onError = sinon.stub();
|
|
62
|
+
service.setClient({
|
|
63
|
+
onDidFilesChanged: () => undefined,
|
|
64
|
+
onError,
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
afterEach(() => {
|
|
69
|
+
subscribeStub?.restore();
|
|
70
|
+
consoleErrorStub.restore();
|
|
71
|
+
track.cleanupSync();
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('retries when subscribe throws a transient ENOENT and the watched root still exists', async () => {
|
|
75
|
+
let attempts = 0;
|
|
76
|
+
subscribeStub = sinon.stub(parcel, 'subscribe').callsFake(async () => {
|
|
77
|
+
attempts++;
|
|
78
|
+
if (attempts < 3) {
|
|
79
|
+
throw new Error('No such file or directory at /tmp/rotated-log');
|
|
80
|
+
}
|
|
81
|
+
return { unsubscribe: async () => undefined };
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
await service.watchFileChanges(0, root.toString());
|
|
85
|
+
// Backoff schedule for two retries: 100 + 200 = 300ms. Leave generous margin.
|
|
86
|
+
await new Promise(resolve => setTimeout(resolve, 800));
|
|
87
|
+
|
|
88
|
+
expect(attempts, 'subscribe should have been retried until it succeeded').to.equal(3);
|
|
89
|
+
expect(onError.called, 'no error should surface to the client once the retry recovered').to.equal(false);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it('does not retry on non-ENOENT errors and surfaces the failure immediately', async () => {
|
|
93
|
+
subscribeStub = sinon.stub(parcel, 'subscribe').callsFake(async () => {
|
|
94
|
+
throw new Error('EACCES: permission denied');
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
await service.watchFileChanges(0, root.toString());
|
|
98
|
+
await new Promise(resolve => setTimeout(resolve, 200));
|
|
99
|
+
|
|
100
|
+
expect(subscribeStub.callCount, 'non-transient errors must not trigger any retry').to.equal(1);
|
|
101
|
+
expect(onError.called, 'error must be reported to the client').to.equal(true);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('gives up after the retry budget is exhausted on persistent ENOENT', async () => {
|
|
105
|
+
subscribeStub = sinon.stub(parcel, 'subscribe').callsFake(async () => {
|
|
106
|
+
throw new Error('No such file or directory at /tmp/rotated-log');
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
await service.watchFileChanges(0, root.toString());
|
|
110
|
+
// Total backoff is 100+200+300+400 = 1000ms; leave a margin for scheduling.
|
|
111
|
+
await new Promise(resolve => setTimeout(resolve, 1700));
|
|
112
|
+
|
|
113
|
+
// Initial attempt + 4 retries = 5 total subscribe calls.
|
|
114
|
+
expect(subscribeStub.callCount, 'should retry up to the budget then give up').to.equal(5);
|
|
115
|
+
expect(onError.called, 'error must surface once the retry budget is exhausted').to.equal(true);
|
|
116
|
+
});
|
|
117
|
+
});
|