Skip to content

Commit

Permalink
test: check the different error code on IBM i
Browse files Browse the repository at this point in the history
Fixes: #36925

PR-URL: #38159
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
  • Loading branch information
dmabupt committed Apr 12, 2021
1 parent 548cbf0 commit db9cf52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
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);
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;
}

0 comments on commit db9cf52

Please sign in to comment.