Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b89297b

Browse filesBrowse files
ofrobotsMylesBorins
authored andcommitted
test: fix test-fs-watch-system-limit
On some systems the default inotify limits might be too high for the test to actually fail. Detect and skip the test in such environments. PR-URL: #23986 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 17c2ddd commit b89297b
Copy full SHA for b89297b

File tree

Expand file treeCollapse file tree

1 file changed

+15
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+15
-0
lines changed
Open diff view settings
Collapse file

‎test/sequential/test-fs-watch-system-limit.js‎

Copy file name to clipboardExpand all lines: test/sequential/test-fs-watch-system-limit.js
+15Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,28 @@
22
const common = require('../common');
33
const assert = require('assert');
44
const child_process = require('child_process');
5+
const fs = require('fs');
56
const stream = require('stream');
67

78
if (!common.isLinux)
89
common.skip('The fs watch limit is OS-dependent');
910
if (!common.enoughTestCpu)
1011
common.skip('This test is resource-intensive');
1112

13+
try {
14+
// Ensure inotify limit is low enough for the test to actually exercise the
15+
// limit with small enough resources.
16+
const limit = Number(
17+
fs.readFileSync('/proc/sys/fs/inotify/max_user_watches', 'utf8'));
18+
if (limit > 16384)
19+
common.skip('inotify limit is quite large');
20+
} catch (e) {
21+
if (e.code === 'ENOENT')
22+
common.skip('the inotify /proc subsystem does not exist');
23+
// Fail on other errors.
24+
throw e;
25+
}
26+
1227
const processes = [];
1328
const gatherStderr = new stream.PassThrough();
1429
gatherStderr.setEncoding('utf8');

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.