eygraber
07/23/2024, 3:13 AM--no-build-cache --no-configuration-cache --rerun-tasks
causes the flakiness to go away, but when I remove those flags it comes back.
I deleted all of the caches in GitHub Actions, and disabled all CI jobs except the tests, but the build scan still shows some cache hits. I'm assuming that's where the flakiness is coming from, but I have no idea where Gradle is finding this cache.
Anyone know where the flakiness / cache is coming from?Adam S
07/23/2024, 4:50 AMAdam S
07/23/2024, 4:54 AM--no-configuration-cache
will stop tasks from running in parallel, so each individual test will have more system resources. GitHub runner are on the lower end of specs, which usually isn't a problem, but it could be, if there are many high-intensity tests?Adam S
07/23/2024, 5:13 AMval intents = ArrayList<Intent>()
isn't getting updated correctly? I haven't looked in detail, so I'm just guessing, but should it be a threadsafe collection instead?
https://github.com/eygraber/vice/blob/ce0a88c4352bc48811290ee66cf2ad031021c99e/vice-core/src/jvmTest/kotlin/com/eygraber/vice/filter/ThrottlingIntentUiTest.kt#L470eygraber
07/23/2024, 5:45 AM--no-configuration-cache
stop tasks from running in parallel. Configuration is single threaded, but task execution shouldn't be affected by that.
The whole flow should be happening on the main thread (see how ViceContainer handles that) so it shouldn't need to be thread safe.Adam S
07/23/2024, 5:48 AMAll tasks run in parallel by default, subject to dependency constraints.https://docs.gradle.org/8.9/userguide/configuration_cache.html#config_cache:intro:performance_improvements
Adam S
07/23/2024, 5:49 AMwasyl
07/23/2024, 6:02 AM--max-workers=1
flag — while your code might be thread safe, there may be something surprising in Compose/skiko/junit internalswasyl
07/23/2024, 6:04 AMthought it might be related to the resources that are available, but the flakiness is gone if I disable the build and configuration cache, and rerun the tasks.Do you have a scan of a successful run?
eygraber
07/23/2024, 6:51 PM--max-workers=1
failed as well.
Here's a working one https://scans.gradle.com/s/oayugsnroamyu/performance/build-cache
The only difference is that the cache isn't used at all.Adam S
07/23/2024, 8:21 PM./gradlew clean
then ./gradlew check --configuration-cache --rerun-tasks
locally, do you get test failures?eygraber
07/23/2024, 8:59 PMeygraber
07/23/2024, 9:01 PMAll tasks run in parallel by default, subject to dependency constraints.
I have parallel builds enabled explicitly
Adam S
07/23/2024, 9:13 PMNope, everything passesFunny... when I run
./gradlew check --configuration-cache --rerun-tasks
most of ThrottlingIntentUiTest fails!eygraber
07/23/2024, 9:14 PMeygraber
07/23/2024, 9:14 PMAdam S
07/23/2024, 9:21 PMTestContainer
to use a Mutex to protect the intents list, a lot of the tests fail. Why should that be? 🤔
val intents = mutableListOf<Intent>()
private val lock = Mutex()
override val compositor = object : ViceCompositor<Intent, Any> {
@Composable
override fun composite() = Any()
override suspend fun onIntent(intent: Intent): Unit = lock.withLock {
intents += intent
}
}
eygraber
07/23/2024, 10:29 PMallTests
(with the Mutex
change and without).
check
works without the Mutex
change, and with the change it has flaky behavior (but still sometimes passes).eygraber
07/23/2024, 10:32 PMonIntent
to sanity check that everything was happening on the main thread (it is) and now it started exhibiting flaky behavior with allTests
and check
😵💫eygraber
07/23/2024, 11:01 PMeygraber
07/23/2024, 11:37 PMAdam S
07/24/2024, 10:17 AM