Skip to content

Commit

Permalink
fix: extend test timeout for windows
Browse files Browse the repository at this point in the history
give windows extra time to complete tests

Fix #4425

Signed-off-by: Douglas McConnachie <[email protected]>
  • Loading branch information
dougal83 authored and raymondfeng committed Feb 17, 2020
1 parent 53211c8 commit 249198e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,10 @@ describe('HttpCachingProxy', () => {
expect(result2).to.equal('2');
});

it('handles the case where backend service is not running', async () => {
it('handles the case where backend service is not running', async function() {
// This test takes a bit longer to finish on windows.
// eslint-disable-next-line no-invalid-this
this.timeout(3000);
await givenRunningProxy({logError: false});

await expect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,21 @@ describe('HttpServer (integration)', () => {
.expect(200);
});

it('stops server', async () => {
it('stops server', async function() {
// This test takes a bit longer to finish on windows.
// eslint-disable-next-line no-invalid-this
this.timeout(3000);
const serverOptions = givenHttpServerConfig();
server = new HttpServer(dummyRequestHandler, serverOptions);
await server.start();
await server.stop();
await expect(httpGetAsync(server.url)).to.be.rejectedWith(/ECONNREFUSED/);
});

it('stops server with grace period and inflight request', async () => {
it('stops server with grace period and inflight request', async function() {
// This test takes a bit longer to finish on windows.
// eslint-disable-next-line no-invalid-this
this.timeout(3000);
const serverOptions = givenHttpServerConfig() as HttpServerOptions;
serverOptions.gracePeriodForClose = 1000;
const {emitter, deferredRequestHandler} = createDeferredRequestHandler();
Expand All @@ -77,7 +83,10 @@ describe('HttpServer (integration)', () => {
await expect(httpGetAsync(server.url)).to.be.rejectedWith(/ECONNREFUSED/);
});

it('stops server with shorter grace period and inflight request', async () => {
it('stops server with shorter grace period and inflight request', async function() {
// This test takes a bit longer to finish on windows.
// eslint-disable-next-line no-invalid-this
this.timeout(3000);
const serverOptions = givenHttpServerConfig() as HttpServerOptions;
serverOptions.gracePeriodForClose = 10;
const {deferredRequestHandler} = createDeferredRequestHandler();
Expand Down

0 comments on commit 249198e

Please sign in to comment.