From db9cf52dcfbb17650af64852cc9b62dad7cfe30b Mon Sep 17 00:00:00 2001 From: Xu Meng Date: Thu, 8 Apr 2021 20:39:31 -0500 Subject: [PATCH] test: check the different error code on IBM i Fixes: https://github.com/nodejs/node/issues/36925 PR-URL: https://github.com/nodejs/node/pull/38159 Reviewed-By: Colin Ihrig Reviewed-By: Darshan Sen Reviewed-By: Richard Lau --- test/parallel/parallel.status | 2 -- test/parallel/test-fs-read-type.js | 8 ++++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/parallel/parallel.status b/test/parallel/parallel.status index c69008fde4aabb..7cc1b5fb33c4d2 100644 --- a/test/parallel/parallel.status +++ b/test/parallel/parallel.status @@ -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 diff --git a/test/parallel/test-fs-read-type.js b/test/parallel/test-fs-read-type.js index 5635fe0a662c64..81440ab57eb802 100644 --- a/test/parallel/test-fs-read-type.js +++ b/test/parallel/test-fs-read-type.js @@ -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'); } })); @@ -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; }