Commit 13ba5c6
authored
ci: increase timeout and optimize docker-compose startup for integrat… (#634)
The GitHub Actions integration test was timing out because:
1. The docker compose up --wait command has a default 10-minute timeout
2. Building 3 Java services from source (db, yaci-indexer, api) + Maven
dependency downloads takes longer than 10 minutes in CI/CD
3. The log showed the build process got stuck during Docker image
building
Changes Applied:
1. .github/workflows/integration-test.yaml:16
- Added --wait-timeout 1200 (20 minutes) to the docker compose command
- Added Docker Buildx setup action for better caching support
2. docker-compose-api.yaml:61-70
- Added explicit depends_on for db and yaci-indexer services
- Optimized healthcheck timing:
- Changed interval from 30s → 10s (more frequent checks)
- Increased retries from 20 → 40
- Extended start_period from 20s → 60s (gives Spring Boot more time to
start)
- Reduced timeout from 10s → 5s (faster failure detection)
- Total max wait time remains ~7 minutes but with better responsiveness
3. docker-integration-test-environment.yaml:27-29
- Added depends_on for yaci-cli to wait for database health before
starting
Expected Improvements:
- Prevents timeout failures by allowing up to 20 minutes for service
startup
- Better service orchestration with explicit dependency chains (db →
yaci-cli/yaci-indexer → api)
- Faster health detection with 10s intervals instead of 30s
- Better Docker caching with Buildx action (will speed up future builds)
Additional Recommendations for Future:
1. Pre-build and cache Docker images in CI/CD to avoid building from
source every time
2. Use GitHub Actions cache for Maven dependencies
3. Consider splitting the workflow to build images separately and reuse
them in integration tests
The changes are minimal and backward-compatible. Your local environment
will continue to work as before, and the CI/CD should now complete
successfully without timing
out.File tree
3 files changed
+16
-5
lines changed- .github/workflows
3 files changed
+16
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | | - | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
61 | 66 | | |
62 | 67 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
67 | 72 | | |
68 | 73 | | |
69 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
27 | 31 | | |
0 commit comments