Skip to content

Commit

Permalink
test: s390x zlib test case fixes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
AdamMajer authored and juanarbol committed Mar 5, 2023
1 parent ed3fb52 commit 9d40aef
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions test/parallel/test-whatwg-webstreams-compression.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,19 @@ async function test(format) {
const reader = gunzip.readable.getReader();
const writer = gzip.writable.getWriter();

const compressed_data = [];
const reader_function = ({ value, done }) => {
if (value)
compressed_data.push(value);
if (!done)
return reader.read().then(reader_function);
assert.strictEqual(dec.decode(Buffer.concat(compressed_data)), 'hello');
};
const reader_promise = reader.read().then(reader_function);

await Promise.all([
reader.read().then(({ value, done }) => {
assert.strictEqual(dec.decode(value), 'hello');
}),
reader.read().then(({ done }) => assert(done)),
reader_promise,
reader_promise.then(() => reader.read().then(({ done }) => assert(done))),
writer.write('hello'),
writer.close(),
]);
Expand Down

0 comments on commit 9d40aef

Please sign in to comment.