Skip to content

Commit f1b5f93

Browse files
AdamMajerruyadorno
authored andcommitted
test: s390x z15 accelerated zlib fixes
Modern s390x x15 has accelerated zlib operations on the CPU. Many distros currently have patches to take advantage of this feature. One side-effect of these patches is that compression routine is no longer deterministic as with software. Interruption to input produces different compressed results. Invalid input can result in processor fault. PR-URL: #44117 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Richard Lau <rlau@redhat.com>
1 parent fb11643 commit f1b5f93

3 files changed

+5
-3
lines changed

test/parallel/test-zlib-dictionary-fail.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const input = Buffer.from([0x78, 0xBB, 0x04, 0x09, 0x01, 0xA5]);
5353
stream.on('error', common.mustCall(function(err) {
5454
// It's not possible to separate invalid dict and invalid data when using
5555
// the raw format
56-
assert.match(err.message, /invalid/);
56+
assert.match(err.message, /(invalid|Operation-Ending-Supplemental Code is 0x12)/);
5757
}));
5858

5959
stream.write(input);

test/parallel/test-zlib-flush-drain-longblock.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ zipper.write('A'.repeat(17000));
1616
zipper.flush();
1717

1818
let received = 0;
19-
unzipper.on('data', common.mustCall((d) => {
19+
unzipper.on('data', common.mustCallAtLeast((d) => {
2020
received += d.length;
2121
}, 2));
2222

test/parallel/test-zlib-from-string.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ const expectedBase64Gzip = 'H4sIAAAAAAAAA11RS05DMQy8yhzg6d2BPSAkJPZu4laWkjiN4' +
5555
'sHnHNzRtagj5AQAA';
5656

5757
zlib.deflate(inputString, common.mustCall((err, buffer) => {
58-
assert.strictEqual(buffer.toString('base64'), expectedBase64Deflate);
58+
zlib.inflate(buffer, common.mustCall((err, inflated) => {
59+
assert.strictEqual(inflated.toString(), inputString);
60+
}));
5961
}));
6062

6163
zlib.gzip(inputString, common.mustCall((err, buffer) => {

0 commit comments

Comments
 (0)