Skip to content

Commit

Permalink
fixup! fix: don't resume while piping request
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed May 12, 2020
1 parent 8f39646 commit 5635cac
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions test/client-pipelining.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,49 +373,6 @@ test('pipelining non-idempotent', (t) => {
})
})

test('pipelining non-idempotent', (t) => {
t.plan(4)

const server = createServer()
server.on('request', (req, res) => {
setTimeout(() => {
res.end('asd')
}, 10)
})
t.tearDown(server.close.bind(server))

server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`, {
pipelining: 2
})
t.tearDown(client.close.bind(client))

let ended = false
client.request({
path: '/',
method: 'GET'
}, (err, data) => {
t.error(err)
data.body
.resume()
.on('end', () => {
t.pass()
ended = true
})
})

client.request({
path: '/',
method: 'GET',
idempotent: false
}, (err, data) => {
t.error(err)
t.strictEqual(ended, true)
data.body.resume()
})
})
})

test('pipelining non-idempotent w body', (t) => {
t.plan(4)

Expand Down

0 comments on commit 5635cac

Please sign in to comment.