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 e373144

Browse filesBrowse files
LiviaMedeirosruyadorno
authored andcommitted
test: add filesystem check to test-fs-stat-date.mjs
PR-URL: #44174 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent a3cc8ce commit e373144
Copy full SHA for e373144

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

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

‎test/parallel/test-fs-stat-date.mjs‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-stat-date.mjs
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ const filepath = path.resolve(tmpdir.path, 'timestamp');
1717

1818
await (await fsPromises.open(filepath, 'w')).close();
1919

20+
// Perform a trivial check to determine if filesystem supports setting
21+
// and retrieving atime and mtime. If it doesn't, skip the test.
22+
await fsPromises.utimes(filepath, 2, 2);
23+
const { atimeMs, mtimeMs } = await fsPromises.stat(filepath);
24+
if (atimeMs !== 2000 || mtimeMs !== 2000) {
25+
common.skip(`Unsupported filesystem (atime=${atimeMs}, mtime=${mtimeMs})`);
26+
}
27+
2028
// Date might round down timestamp
2129
function closeEnough(actual, expected, margin) {
2230
// On ppc64, value is rounded to seconds

0 commit comments

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