Compare commits

...
Author SHA1 Message Date
Thomas SharedInboxandClaude Sonnet 4.6 dcb0cbd539 fix(android): prevent Gradle daemon hang in Firebase test build (#155)
Dagger preserves filesystem snapshots between WithExec steps but kills
background processes. After `flutter build apk --debug` completes, the
Gradle daemon registry file remains in /home/ci/.gradle/daemon/ while
the daemon process itself is gone. The subsequent `./gradlew
app:assembleAndroidTest` step finds the stale registry entry, tries to
connect to the dead daemon, and hangs.

Fix by:
- Adding --no-daemon to the assembleAndroidTest gradlew call so it runs
  in-process and never consults the daemon registry.
- Mounting the gradle-cache volume (same as Base()) so dependencies are
  cached between runs rather than re-downloaded from scratch each time.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-23 15:41:24 +02:00
+4 -1
View File
@@ -649,9 +649,12 @@ func (m *Ci) DeployApk(
// Returns a flat directory with app-debug.apk and app-debug-androidTest.apk.
func (m *Ci) BuildAndroidDebugApks() *dagger.Directory {
built := m.setup(m.firebaseSrc()).
WithMountedCache("/home/ci/.gradle", dag.CacheVolume("gradle-cache"), dagger.ContainerWithMountedCacheOpts{Owner: "ci"}).
WithExec([]string{"flutter", "build", "apk", "--debug", "--no-pub"}).
WithWorkdir("/src/android").
WithExec([]string{"./gradlew", "app:assembleAndroidTest"}).
// --no-daemon avoids connecting to a stale daemon whose registry file was
// preserved in the Dagger layer snapshot but whose process no longer exists.
WithExec([]string{"./gradlew", "--no-daemon", "app:assembleAndroidTest"}).
WithWorkdir("/src").
WithExec([]string{"/bin/bash", "-c",
`apk=$(find /src -path "*androidTest*" -name "*.apk" -type f 2>/dev/null | head -1) && \