Skip to content

Commit

Permalink
Fix tests that ran out of time
Browse files Browse the repository at this point in the history
  • Loading branch information
szmarczak committed May 15, 2019
1 parent b25abbe commit aa5dc16
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions test/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ test('`maxSessions` option works', singleRequestWrapper, async (t, server) => {
t.is(typeof Object.values(agent.queue)[0], 'function');
t.is(Object.values(agent.freeSessions).length, 0);
t.is(Object.values(agent.busySessions)[0].length, 1);

agent.destroy();
});

test('destroys free sessions', wrapper, async (t, server) => {
Expand Down
6 changes: 3 additions & 3 deletions test/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const intervalHandler = (request, response) => {
i++;
response.write(i.toString());
}
}, 500);
}, 250);
};

test('properties', wrapper, async (t, server) => {
Expand Down Expand Up @@ -111,7 +111,7 @@ test('pausing & resuming', wrapper, async (t, server) => {
const firstChunk = await pEvent(response, 'data');

response.pause();
await delay(600);
await delay(300);
response.resume();

const secondChunk = await pEvent(response, 'data');
Expand All @@ -132,7 +132,7 @@ test('reading parts of the response', wrapper, async (t, server) => {
await pEvent(response, 'readable');

t.is(response.read(1), '0');
await delay(1100);
await delay(550);
t.is(response.read(1), '1');
t.is(response.read(1), '2');

Expand Down

0 comments on commit aa5dc16

Please sign in to comment.