-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v16.x backport] fs: use signed types for stat data #44129
[v16.x backport] fs: use signed types for stat data #44129
Conversation
This allows to support timestamps before 1970-01-01. On Windows, it's not supported due to Y2038 issue. PR-URL: nodejs#43714 Fixes: nodejs#43707 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Backport-PR-URL: nodejs#44129
897dffa
to
209b287
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This allows to support timestamps before 1970-01-01. On Windows, it's not supported due to Y2038 issue. PR-URL: nodejs#43714 Fixes: nodejs#43707 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Backport-PR-URL: nodejs#44129
209b287
to
e874ded
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Doesn't that mean that 9e40873...5311b7d should be fast-tracked on |
FWIW as background arm-12+ is referring to https://ci.nodejs.org/job/node-test-binary-arm-12+/ which is the job that runs tests for armv7l on Raspberry Pi devices. They currently aren't being run on main/v18.x as they need updates which is why the failures haven't been seen until the tests were ported here to v16 (where we're still running tests on the Pi's). Also FWIW I suspect the issue isn't actually Linux on arm but the filesystem being used. |
Yes, if similar test environment will be used on newer versions as well.
Thanks for clarification! Which FS is used on that test platform? Is there a straightforward way to detect it? await fsPromises.utimes(filepath, 1000, 1000);
const { atimeMs, mtimeMs } = await fsPromises.stat(filepath);
if (atimeMs !== 1000 || mtimeMs !== 1000) common.skip('bad platform or fs'); But it still feels weird to literally skip a test if it fails. 😅 |
I disagree, it's not because this project doesn't have a CI for this environment that it's not worth landing it on |
They are NFS mounts, e.g. $ df -Th /home/iojs/build/workspace/node-test-binary-arm/
Filesystem Type Size Used Avail Use% Mounted on
192.168.1.10:/exports/nodejs/pi/test-requireio_williamkapke-debian10-arm64_pi3-3 nfs 458G 206G 230G 48% /
$ On the Pi's the tests are run in containers and folder above is mounted inside the container on the machine. |
Perhaps I worded it incorrectly: test env was related to fast-tracking, i.e. if it should be ported to As for local user environments, I think it would be reasonable to keep the test as strict as possible, as long as it doesn't break common cases (example: absence of ipv6 support is common, blocked ports for localhost are not), and doesn't unconditionally break CI. If there is a better approach for such tests, I'm open for suggestions.
I guess NFS might not support
Yes. If #43714 with #44174 will be mergeable into v16 without any problems, the label can be removed and this PR can be closed. |
Superseded by #44174 |
Backport of: #43714
On
arm-12+
,fsPromises.stat
timestamps are returned as 0 even for small positive values. Excluding this platform from test.