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 3f0ff87

Browse filesBrowse files
gireeshpunathilMyles Borins
authored andcommitted
test: fix time resolution constraint
The modification time of a file is assumed to happen at the exact time when it was requested. As the utime API specification delcares that the resolution of the result is 1 second, relax the constrain to 1 second helps the test case to be robust and consistent under different load conditions in the system PR-URL: #3981 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
1 parent 22b88e1 commit 3f0ff87
Copy full SHA for 3f0ff87

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+1
-1
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-fs-utimes.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-utimes.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function check_mtime(resource, mtime) {
2323
var real_mtime = fs._toUnixTimestamp(stats.mtime);
2424
// check up to single-second precision
2525
// sub-second precision is OS and fs dependant
26-
return Math.floor(mtime) == Math.floor(real_mtime);
26+
return mtime - real_mtime < 2;
2727
}
2828

2929
function expect_errno(syscall, resource, err, errno) {

0 commit comments

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