fs: preserve negative utimes timestamps - #64627
GiHoon1123 wants to merge 3 commits into
Conversation
|
Just checking in on this one when you have a chance. No rush. |
This comment was marked as outdated.
This comment was marked as outdated.
|
|
|
Thanks for flagging this. It looks like AIX rejects negative timestamps outright, so this needs a bit more investigation than just adjusting the test. I won't be able to look into it right away, but I'll follow up when I can. |
|
Following up on the thread here, simply skipping AIX explicitly in the test via @GiHoon1123 are you still interested in seeing this one through? Alternatively I could pick this one up as well. |
|
I am still interested in seeing this through. I added the AIX-specific skip for the negative timestamp case and pushed a follow-up commit. I also updated the PR description to note the platform-specific behavior. |
Signed-off-by: Gihoon1123 <rlaejrqo465@naver.com>
Signed-off-by: Gihoon1123 <rlaejrqo465@naver.com>
a495657 to
6cb3923
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #64627 +/- ##
==========================================
+ Coverage 90.14% 90.35% +0.21%
==========================================
Files 741 792 +51
Lines 242076 275495 +33419
Branches 45558 52791 +7233
==========================================
+ Hits 218216 248933 +30717
- Misses 15385 16985 +1600
- Partials 8475 9577 +1102
🚀 New features to boost your workflow:
|
|
For the remaining Windows failure this seems to be a limitation of not having full 64 bit time, so all negative epoch times on Windows are reported as post 2038 times instead! Unfortunately no easy way to fix that without having support for 64 bit time in libuv. A few options:
3 is the right fix, 2 is a good stopgap. But given the responses I've had to libuv PRs recently I'm really not sure we can rely on any fix being possible here. |
|
Correction, it seems Node.js was the one that decided to allow post-2038 times on Windows only utilizing the negative time range for this. Therefore this is in fact a decision that Node.js could turn around on and decide to align with POSIX in treating negative times as negative epoch not in the future. Since this is a rarely-used Windows specific behavior, I'm tempted to say that that is the correct fix - changing the behavior of the test in |
|
The Windows behavior where a negative epoch is interpreted as a wrapped 32-bit future date appears to be a separate, pre-existing design decision, covered by the This PR’s new negative-timestamp assertion is simply the first test to reach that path on Windows, since Would it be reasonable to skip the new negative-timestamp assertion on Windows for now, as we do on AIX, and discuss changing the existing behavior separately with input from the relevant collaborators? Alternatively, would you prefer that this PR also remove the existing Windows |
|
I honestly think it would be worth rethinking that previous design decision here for Windows and changing that Perhaps @LiviaMedeiros or others can share their thoughts if they think this is something we can change at this point. I struggle to see how anyone would be relying on post-2038 times in Node.js using this technique though. |
|
I think changing it is reasonable. I think it likely has to be semver-major, however. |
Signed-off-by: GiHoon1123 <rlaejrqo465@naver.com>
4da9263 to
30fa54a
Compare
toUnixTimestamp()converted negative numbers to the current time, while negative strings and Dates were handled correctly.Keep numeric timestamps unchanged and add coverage for negative values.
On AIX, negative timestamps are unsupported, so the test skips that platform-specific case while retaining the coverage on supported platforms.
Fixes: #64597