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 fe91beb

Browse filesBrowse files
LiviaMedeirosdanielleadams
authored andcommitted
test: loosen test for negative timestamps in test-fs-stat-date
PR-URL: #44707 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
1 parent db5aeed commit fe91beb
Copy full SHA for fe91beb

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
@@ -31,6 +31,14 @@ function closeEnough(actual, expected, margin) {
3131
if (process.arch === 'ppc64') {
3232
margin += 1000;
3333
}
34+
35+
// Filesystems without support for timestamps before 1970-01-01, such as NFSv3,
36+
// should return 0 for negative numbers. Do not treat it as error.
37+
if (actual === 0 && expected < 0) {
38+
console.log(`ignored 0 while expecting ${expected}`);
39+
return;
40+
}
41+
3442
assert.ok(Math.abs(Number(actual - expected)) < margin,
3543
`expected ${expected} ± ${margin}, got ${actual}`);
3644
}

0 commit comments

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