java-sdk icon indicating copy to clipboard operation
java-sdk copied to clipboard

Optimize CI/CD build times - Integration tests timing

Open cicoyle opened this issue 4 months ago • 2 comments

The CI/CD pipeline is experiencing timeouts during integration tests, specifically for Spring Boot 3.3.9. The build job Build jdk:17 sb:3.3.x exp:false is being cancelled after exceeding the 30-minute execution limit, as seen in this failed run.

Current State

  • Integration tests are taking longer than 30 minutes to complete
  • The workflow includes resource-intensive operations, for ex:
    • Docker container setup (MongoDB, Kafka)
    • Dapr CLI and runtime initialization
    • Complex workflow testing with external dependencies
  • Tests run sequentially without parallelization

Proposed Solutions

Parallel Test Execution

  • Enable Maven Surefire parallel execution for unit tests
  • Configure Maven Failsafe for parallel integration tests
  • Add parallel module building with -T flags

Split Workflow Strategy

  • Separate unit tests from integration tests into different jobs
  • Run unit tests first and in parallel
  • Only run integration tests (in parallel) after unit tests pass
  • Use focused timeouts for each job type

Test Optimization

  • Review and optimize slow integration tests

Expected Benefits

  • Reduce overall build time by ~30-50%
  • Eliminate timeout issues
  • Improve developer experience with faster feedback at PR time
  • Reduce CI/CD resource usage

Acceptance Criteria

  • [ ] Build completes within reasonable time (< 20 minutes)
  • [ ] All existing tests continue to pass
  • [ ] No regression in test coverage
  • [ ] Maintainable and clear CI/CD configuration

cicoyle avatar Aug 26 '25 14:08 cicoyle

These PR and PR solves some of the issues described above

javier-aliaga avatar Aug 29 '25 07:08 javier-aliaga

I think we should close this one now..

salaboy avatar Sep 08 '25 09:09 salaboy