Skip to content

Commit 9d40aef

Browse files
AdamMajerjuanarbol
authored andcommitted
test: s390x zlib test case fixes
This is similar to #44117 and addresses the indeterminate nature of the hardware accelerated compression. PR-URL: #46367 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
1 parent ed3fb52 commit 9d40aef

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

test/parallel/test-whatwg-webstreams-compression.js

+12-4
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,19 @@ async function test(format) {
2020
const reader = gunzip.readable.getReader();
2121
const writer = gzip.writable.getWriter();
2222

23+
const compressed_data = [];
24+
const reader_function = ({ value, done }) => {
25+
if (value)
26+
compressed_data.push(value);
27+
if (!done)
28+
return reader.read().then(reader_function);
29+
assert.strictEqual(dec.decode(Buffer.concat(compressed_data)), 'hello');
30+
};
31+
const reader_promise = reader.read().then(reader_function);
32+
2333
await Promise.all([
24-
reader.read().then(({ value, done }) => {
25-
assert.strictEqual(dec.decode(value), 'hello');
26-
}),
27-
reader.read().then(({ done }) => assert(done)),
34+
reader_promise,
35+
reader_promise.then(() => reader.read().then(({ done }) => assert(done))),
2836
writer.write('hello'),
2937
writer.close(),
3038
]);

0 commit comments

Comments
 (0)