I started seeing an issue in my project after enab...
# gradle
e
I started seeing an issue in my project after enabling the configuration cache where KGP's allTests task hangs and never completes when the configuration cache wasn't able to be reused. I have some thread dumps, but I'm not sure if I should file an issue with Gradle or Kotlin. Any pointers?
a
1. Is the project open source? Could you share a reproducer? 2. What versions of KGP, Gradle (and
./gradlew --version
) are you using? 3. What other Gradle plugins are used? 4. What KMP targets are enabled? If you disable the targets one-by-one, does it show that one target is a problem? 5. Do other tasks, like
./gradlew build
, also hang? 6. Could you share the console output? (in Slack you can do 'create snippet' to share a large text output)
t
Could you share the console output?
Better Gradle build scan + Kotlin daemon logs
e
1. https://github.com/eygraber/sqldelight-androidx-driver/ 2. Kotlin 2.2.0 Gradle 9.0.0 3. Detekt, AtomicFu 4. Android, ios, Jvm, Linux, Mac 5. No
Gradle build scan + Kotlin daemon logs
I can't get the build scan because the build never completes. I will try to get the daemon logs when I repro again
Untitled
a
so it's stuck on
Extracting dependency...
? 🤔
e
I don't think so, but it's not clear. I thought that just happened to be the last thing that was logged.
true 1
Here are two thread dumps from after it hung
a
one of the test classes is
AndroidxSqliteConcurrencyIntegrationTest
... given that enabling CC means tests from different projects can run at the same time, maybe one of the tests is locking a shared resource?
AndroidxSqliteConcurrencyIntegrationTest
is in commonTest, so it will be run multiple times (once for each target). When CC is enabled, the test tasks will run in parallel, so
concurrency_integration.db
will be opened multiple times simultaneously
e
I believe I addressed that previously, but maybe I missed something. Running
allTests
again after killing the hanging one seems to work though.
a
Copy code
override var type: AndroidxSqliteDatabaseType = AndroidxSqliteDatabaseType.File("concurrency_integration-${Random.nextULong()}.db")
making the name random fixes it on my machine (just a quick fix - deleting the db after the test would be nicer)
e
Ah the issue is I already did this for
AndroidxSqliteConcurrencyTest
but not for
AndroidxSqliteConcurrencyIntegrationTest
🙈
a
I wonder... isn't
runTest {}
supposed to timeout? That would have helped reveal it wasn't a Gradle issue.
e
Good point, maybe because it's blocking the whole thread and isn't participating in coroutines?
a
worth looking into :)