Skip to content

Commit 2d5366d

Browse files
authored
test: preserve allowCypressEnv in subscription test config rewrites (#33910)
These two subscription tests overwrite the cypress-in-cypress fixture's cypress.config.js wholesale. The original fixture has `allowCypressEnv: false`, but the rewrites omitted it — letting the value flip back to its default `true`. That option is flagged `requireRestartOnChange: 'server'`, so the config reload triggers initializeActiveProject → OpenProject.create, which tries to re-bind port 4455 before the previous server has released it. The result on Mac/Linux is a "Port 4455 is already in use" error mid-test and the UI gets stuck on the original spec list — the flake we kept seeing as "Found 17, expected 3". Preserving allowCypressEnv: false matches the fixture and skips the server restart entirely.
1 parent fcee425 commit 2d5366d

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

packages/app/cypress/e2e/subscriptions/errorWarningChange-subscription.cy.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ describe('errorWarningChange subscription', () => {
2323
await ctx.actions.file.writeFileInProject('cypress.config.js',
2424
`
2525
module.exports = {
26+
allowCypressEnv: false,
2627
projectId: 'abc123',
2728
component: {
2829
viewportHeight: '20',
@@ -36,6 +37,7 @@ module.exports = {
3637
await ctx.actions.file.writeFileInProject('cypress.config.js',
3738
`
3839
module.exports = {
40+
allowCypressEnv: false,
3941
projectId: 'abc123',
4042
component: {
4143
viewportHeight: 20,
@@ -53,6 +55,7 @@ module.exports = {
5355
await ctx.actions.file.writeFileInProject('cypress.config.js',
5456
`
5557
module.exports = {
58+
allowCypressEnv: false,
5659
projectId: 'abc123',
5760
component: {
5861
viewportHeight: ,
@@ -67,6 +70,7 @@ module.exports = {
6770
await ctx.actions.file.writeFileInProject('cypress.config.js',
6871
`
6972
module.exports = {
73+
allowCypressEnv: false,
7074
projectId: 'abc123',
7175
component: {
7276
viewportHeight: 20,

packages/app/cypress/e2e/subscriptions/specChange-subscription.cy.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ describe('specChange subscription', () => {
164164
await ctx.actions.file.writeFileInProject('cypress.config.js',
165165
`
166166
module.exports = {
167+
allowCypressEnv: false,
167168
projectId: 'abc123',
168169
experimentalInteractiveRunEvents: true,
169170
component: {
@@ -312,6 +313,7 @@ e2e: {
312313
await ctx.actions.file.writeFileInProject('cypress.config.js',
313314
`
314315
module.exports = {
316+
allowCypressEnv: false,
315317
projectId: 'abc123',
316318
experimentalInteractiveRunEvents: true,
317319
component: {
@@ -436,6 +438,7 @@ e2e: {
436438
await ctx.actions.file.writeFileInProject('cypress.config.js',
437439
`
438440
module.exports = {
441+
allowCypressEnv: false,
439442
projectId: 'abc123',
440443
experimentalInteractiveRunEvents: true,
441444
component: {
@@ -461,6 +464,7 @@ e2e: {
461464
await ctx.actions.file.writeFileInProject('cypress.config.js',
462465
`
463466
module.exports = {
467+
allowCypressEnv: false,
464468
projectId: 'abc123',
465469
experimentalInteractiveRunEvents: true,
466470
component: {

0 commit comments

Comments
 (0)