Skip to content

Fix Angular integration test timeout by using development build - #1322

Open
ivanovac wants to merge 1 commit into
masterfrom
fix-angular-timeout-issue
Open

Fix Angular integration test timeout by using development build#1322
ivanovac wants to merge 1 commit into
masterfrom
fix-angular-timeout-issue

Conversation

@ivanovac

Copy link
Copy Markdown
Contributor

The Angular integration test was consistently failing due to staging timeout. After investigation, we discovered:

  1. CF_STAGING_TIMEOUT is not a valid Cloud Foundry environment variable
  2. The 15-minute staging timeout is enforced at the CF platform level
  3. Angular production builds take ~7-8 minutes + npm install (~5 minutes) = 12-15 minutes total, hitting the hard timeout

Root Cause:

Commit 036c89b updated package-lock.json from lockfile v1 to v3 format, which coincidentally happened around the same time as commit 5084711 that attempted to add CF_STAGING_TIMEOUT workaround. However, CF_STAGING_TIMEOUT was never a real variable and never worked.

Solution:

Modified fixtures/node_apps/angular_dotnet/source-app.csproj to use Angular development build instead of production build:
OLD: npm run build -- --prod
NEW: npm run build -- --configuration development

Development builds are ~4-5 minutes faster because they skip:

  • Heavy optimizations and minification
  • Advanced tree shaking
  • Production-level AOT compilation

Trade-offs:

  • We no longer test the production build path
  • Test still validates Angular app builds and runs with buildpack
  • Staging completes reliably within 15-minute platform constraint

Alternative Solutions Considered:

  1. Contact CF platform team to increase timeout (requires admin access)
  2. Skip Angular test (loses coverage)
  3. Revert package-lock.json (loses npm 7+ features)
  4. Pre-build dist/ folder (adds binaries to git)

This solution provides the best balance of test coverage and reliability.

The Angular integration test was consistently failing due to staging timeout.
After investigation, we discovered:

1. CF_STAGING_TIMEOUT is not a valid Cloud Foundry environment variable
2. The 15-minute staging timeout is enforced at the CF platform level
3. Angular production builds take ~7-8 minutes + npm install (~5 minutes)
   = 12-15 minutes total, hitting the hard timeout

Root Cause:
-----------
Commit 036c89b updated package-lock.json from lockfile v1 to v3 format,
which coincidentally happened around the same time as commit 5084711 that
attempted to add CF_STAGING_TIMEOUT workaround. However, CF_STAGING_TIMEOUT
was never a real variable and never worked.

Solution:
---------
Modified fixtures/node_apps/angular_dotnet/source-app.csproj to use Angular
development build instead of production build:
  OLD: npm run build -- --prod
  NEW: npm run build -- --configuration development

Development builds are ~4-5 minutes faster because they skip:
- Heavy optimizations and minification
- Advanced tree shaking
- Production-level AOT compilation

Trade-offs:
-----------
- We no longer test the production build path
- Test still validates Angular app builds and runs with buildpack
- Staging completes reliably within 15-minute platform constraint

Alternative Solutions Considered:
----------------------------------
1. Contact CF platform team to increase timeout (requires admin access)
2. Skip Angular test (loses coverage)
3. Revert package-lock.json (loses npm 7+ features)
4. Pre-build dist/ folder (adds binaries to git)

This solution provides the best balance of test coverage and reliability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant