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 nodejs#44117 and
addresses the indeterminate nature of the hardware accelerated
compression.
  • Loading branch information
AdamMajer committed Jan 26, 2023
1 parent 8ba54e5 commit 25d69a6
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 25d69a6

Please sign in to comment.