Skip to content
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

test: check the different error code on IBM i #38159

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions test/parallel/parallel.status
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,3 @@ test-tls-env-extra-ca: SKIP
test-dgram-error-message-address: SKIP
# https://github.com/nodejs/node/issues/36929
test-crypto-secure-heap: SKIP
# https://github.com/nodejs/node/issues/36925
test-fs-read-type: SKIP
8 changes: 6 additions & 2 deletions test/parallel/test-fs-read-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ fs.read(fd,
2n ** 53n - 1n,
common.mustCall((err) => {
if (err) {
assert.strictEqual(err.code, 'EFBIG');
if (common.isIBMi)
assert.strictEqual(err.errno, -127);
Copy link
Contributor

@cjihrig cjihrig Apr 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What error does 127 map to on IBM i? Should we try to map it in libuv?

Copy link
Contributor Author

@dmabupt dmabupt Apr 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is EOVERFLOW

$ grep 127 /usr/include/errno.h 
#define EOVERFLOW       127     /* value too large to be stored in data type */

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What error does 127 map to on IBM i? Should we try to map it in libuv?

@cjihrig PR to add a mapping for EOVERFLOW: libuv/libuv#3145

else
assert.strictEqual(err.code, 'EFBIG');
}
}));

Expand Down Expand Up @@ -239,5 +242,6 @@ try {
// On systems where max file size is below 2^53-1, we'd expect a EFBIG error.
// This is not using `assert.throws` because the above call should not raise
// any error on systems that allows file of that size.
if (err.code !== 'EFBIG') throw err;
if (err.code !== 'EFBIG' && !(common.isIBMi && err.errno === -127))
throw err;
}