Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: attempt to fix intermittent test failures #313

Merged
merged 1 commit into from
Dec 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/httpClient.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ test('client should emit a timeout when no response is received', (t) => {
t.ok(1, 'timeout should have happened')
})

setTimeout(() => client.destroy(), 1500)
setTimeout(() => client.destroy(), 1800)
})

test('client should emit 2 timeouts when no responses are received', (t) => {
Expand All @@ -577,7 +577,7 @@ test('client should emit 2 timeouts when no responses are received', (t) => {
t.ok(1, 'timeout should have happened')
})

setTimeout(() => client.destroy(), 2500)
setTimeout(() => client.destroy(), 2800)
})

test('client should have 2 different requests it iterates over', (t) => {
Expand Down
6 changes: 3 additions & 3 deletions test/runRate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ test('run should only send the expected number of requests per second - scenario
}, (err, res) => {
t.error(err)

t.equal(Math.round(res.duration), 4, 'should have take 4 seconds to send 10 requests per seconds')
t.equal(Math.floor(res.duration), 4, 'should have take 4 seconds to send 10 requests per seconds')
t.equal(res.requests.average, 10, 'should have sent 10 requests per second on average')
})
})
Expand All @@ -31,7 +31,7 @@ test('run should only send the expected number of requests per second - scenario
amount: 40
}, (err, res) => {
t.error(err)
t.equal(Math.round(res.duration), 2, 'should have taken 2 seconds to send 10 requests per connection with 2 connections')
t.equal(Math.floor(res.duration), 2, 'should have taken 2 seconds to send 10 requests per connection with 2 connections')
t.equal(res.requests.average, 20, 'should have sent 20 requests per second on average with two connections')
})
})
Expand All @@ -46,7 +46,7 @@ test('run should only send the expected number of requests per second - scenario
amount: 40
}, (err, res) => {
t.error(err)
t.equal(Math.round(res.duration), 4, 'should have take 4 seconds to send 10 requests per seconds')
t.equal(Math.floor(res.duration), 4, 'should have take 4 seconds to send 10 requests per seconds')
t.equal(res.requests.average, 10, 'should have sent 10 requests per second on average')
})
})
Expand Down