Commit 1d9f786
committed
Fix ConcurrentModificationException in coverage report generation
Problem:
Running tests and coverage report generation as separate Gradle invocations
caused a ConcurrentModificationException when Kover tried to access test
execution data:
Could not determine the dependencies of task ':app:koverGenerateArtifactStandardDebug'
> java.util.ConcurrentModificationException (no error message)
Root Cause:
- Configuration cache is enabled (improves build performance)
- Kover's coverage tasks need test execution data from the same Gradle session
- Separate invocations = separate Gradle daemon sessions
- Coverage report task cannot access test data from previous invocation
- Configuration cache + separate invocations = state corruption
Solution:
Combine test execution and coverage generation into single Gradle command:
BEFORE: ./gradlew :app:testStandardDebug
./gradlew :app:koverXmlReportStandardDebug # Fails!
AFTER: ./gradlew :app:testStandardDebug :app:koverXmlReportStandardDebug
Benefits:
- Both tasks run in same Gradle daemon session
- Coverage task has access to test execution data
- Configuration cache works correctly
- No state corruption between invocations
Applied to all test jobs:
- test-libraries: Combined 6 test + 6 coverage tasks
- test-app: Combined test + coverage
- test-authenticator: Combined test + coverage1 parent 9bf7c2a commit 1d9f786
1 file changed
+12
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
| 188 | + | |
194 | 189 | | |
195 | 190 | | |
196 | | - | |
| 191 | + | |
197 | 192 | | |
198 | 193 | | |
199 | 194 | | |
| |||
249 | 244 | | |
250 | 245 | | |
251 | 246 | | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
| 247 | + | |
258 | 248 | | |
259 | 249 | | |
260 | | - | |
| 250 | + | |
261 | 251 | | |
262 | 252 | | |
263 | 253 | | |
| |||
0 commit comments