Skip to content

Commit 1598894

Browse files
AdamMajerdanielleadams
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 51b4a1b commit 1598894

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy