Skip to content

Commit

Permalink
fix: an issue where test hangs when assertion fails in http2 as http2…
Browse files Browse the repository at this point in the history
…server is not closed
  • Loading branch information
lamweili committed Aug 2, 2022
1 parent 6856f32 commit b908af0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/compression.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,11 @@ describe('compression()', function () {
chunks.push(chunk);
})
request.on('end', function () {
zlib.gunzip(Buffer.concat(chunks), function(err, data) {
assert.strictEqual(data.toString(), 'hello, world')
closeHttp2(client, server, done)
closeHttp2(client, server, function () {
zlib.gunzip(Buffer.concat(chunks), function(err, data) {
assert.strictEqual(data.toString(), 'hello, world')
done()
})
})
})
request.end()
Expand Down

0 comments on commit b908af0

Please sign in to comment.