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: extend test timeout for windows #4657

Merged
merged 2 commits into from
Feb 17, 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
13 changes: 11 additions & 2 deletions packages/cli/test/integration/generators/app.integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,11 @@ describe('app-generator with tilde project path', () => {
const cwd = process.cwd();

// If the test runs outside $home directory
if (process.env.CI && !process.env.DEBUG && tildify(sandbox) === sandbox) {
const runsOutsideRoot =
process.env.CI && !process.env.DEBUG && tildify(sandbox) === sandbox
? true
: false;
if (runsOutsideRoot) {
sandbox = path.join(os.homedir(), '.lb4sandbox/tilde-path-app');
pathWithTilde = '~/.lb4sandbox/tilde-path-app';
}
Expand Down Expand Up @@ -295,7 +299,12 @@ describe('app-generator with tilde project path', () => {
// eslint-disable-next-line no-invalid-this
this.timeout(30 * 1000);

process.chdir(sandbox);
// Handle special case - Skipping... not inside the project root directory.
if (runsOutsideRoot) {
process.chdir(sandbox);
} else {
process.chdir(rootDir);
}
build.clean(['node', 'run-clean', sandbox]);
process.chdir(cwd);
});
Expand Down
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