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(testing): increase the default timeout to 60s for the cypress web dev server to start #22132

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
2 changes: 0 additions & 2 deletions e2e/angular-core/src/projects.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
runCLI,
runCommandUntil,
runE2ETests,
setCypressWebServerTimeout,
tmpProjPath,
uniq,
updateFile,
Expand Down Expand Up @@ -128,7 +127,6 @@ describe('Angular Projects', () => {

// check e2e tests
if (runE2ETests('cypress')) {
setCypressWebServerTimeout(`${app1}-e2e/cypress.config.ts`);
const e2eResults = runCLI(`e2e ${app1}-e2e`);
expect(e2eResults).toContain('All specs passed!');
expect(await killPort(4200)).toBeTruthy();
Expand Down
3 changes: 0 additions & 3 deletions e2e/angular-module-federation/src/module-federation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
runCLI,
runCommandUntil,
runE2ETests,
setCypressWebServerTimeout,
uniq,
updateFile,
} from '@nx/e2e/utils';
Expand Down Expand Up @@ -378,7 +377,6 @@ describe('Angular Module Federation', () => {
expect(buildRemoteOutput).toContain('Successfully ran target build');

if (runE2ETests('cypress')) {
setCypressWebServerTimeout(`${host}-e2e/cypress.config.ts`);
const e2eProcess = await runCommandUntil(`e2e ${host}-e2e`, (output) =>
output.includes('All specs passed!')
);
Expand Down Expand Up @@ -470,7 +468,6 @@ describe('Angular Module Federation', () => {
expect(buildRemoteOutput).toContain('Successfully ran target build');

if (runE2ETests('cypress')) {
setCypressWebServerTimeout(`${host}-e2e/cypress.config.ts`);
const e2eProcess = await runCommandUntil(`e2e ${host}-e2e`, (output) =>
output.includes('All specs passed!')
);
Expand Down
4 changes: 0 additions & 4 deletions e2e/cypress/src/cypress.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
readJson,
runCLI,
runE2ETests,
setCypressWebServerTimeout,
uniq,
updateFile,
} from '@nx/e2e/utils';
Expand Down Expand Up @@ -77,7 +76,6 @@ describe('env vars', () => {
);

if (runE2ETests('cypress')) {
setCypressWebServerTimeout(`apps/${myapp}-e2e/cypress.config.ts`);
// contains the correct output and works
const run1 = runCLI(
`e2e ${myapp}-e2e --config \\'{\\"env\\":{\\"cliArg\\":\\"i am from the cli args\\"}}\\'`
Expand Down Expand Up @@ -169,7 +167,6 @@ export default defineConfig({
);

if (runE2ETests('cypress')) {
setCypressWebServerTimeout(`apps/${appName}/cypress.config.ts`);
expect(runCLI(`run ${appName}:component-test`)).toContain(
'All specs passed!'
);
Expand Down Expand Up @@ -198,7 +195,6 @@ export default defineConfig({
);

if (runE2ETests('cypress')) {
setCypressWebServerTimeout(`apps/${appName}/cypress.config.ts`);
expect(runCLI(`run ${appName}:component-test`)).toContain(
'All specs passed!'
);
Expand Down
2 changes: 0 additions & 2 deletions e2e/next-core/src/next.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
readFile,
runCLI,
runE2ETests,
setCypressWebServerTimeout,
uniq,
updateFile,
} from '@nx/e2e/utils';
Expand Down Expand Up @@ -194,7 +193,6 @@ describe('Next.js Applications', () => {
);

if (runE2ETests('cypress')) {
setCypressWebServerTimeout(`${appName}-e2e/cypress.config.ts`);
const e2eResults = runCLI(`e2e-ci ${appName}-e2e --verbose`, {
verbose: true,
});
Expand Down
2 changes: 1 addition & 1 deletion packages/cypress/plugins/cypress-preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ function waitForServer(
let pollTimeout: NodeJS.Timeout | null;
const { protocol } = new URL(url);

const timeoutDuration = webServerConfig?.timeout ?? 15 * 1000;
const timeoutDuration = webServerConfig?.timeout ?? 60 * 1000;
const timeout = setTimeout(() => {
clearTimeout(pollTimeout);
reject(
Expand Down