https://kotlinlang.org logo
#intellij
Title
# intellij
s

stefano

11/23/2023, 8:26 PM
hi, since the last update I'm experiencing flakiness in IntelliJ picking up test runs. I have a few configurations that run test gradle tasks, and lately when running them I get a
Test events were not received
in the Run tab. Did anyone also experience this or is it only me?
the test suites use
kotest
btw. All the other configurations (e.g. starting a Spring Boot application) work as usual
oh also: it doesn't happen 100% of the time 🤔
a

Adam S

11/24/2023, 12:23 AM
Are you using Gradle to run the tests? Perhaps the tests aren't run because they're up-to-date? (Up until recently IntelliJ forcibly broke Gradle's caching so the tests always ran, but that's fixed now, but some of the messaging hasn't been updated so it looks like the tests are flakey.)
s

stefano

11/24/2023, 6:23 AM
Yes I am invoking Gradle in those configurations. Good to know about the cache fix, wasn’t aware of that. But then what would be the recommended way to setup a configuration to force run a test suite?
a

Adam S

11/24/2023, 7:12 AM
There are a few options, like
./gradlew --rerun test
, but it depends why you want to rerun tests? This blog goes into more detail https://blog.gradle.org/stop-rerunning-tests
s

stefano

11/24/2023, 7:14 AM
Thanks @Adam S that’s very helpful 👍
Yeah I just realized that probably in my case the only reason is for tests that don’t directly call the exercised code (like end to end tests that spin up the app in a docker container), in which case Gradle most likely thinks nothing changed even if the underlying code did. But the post offers a couple of solutions even for that case
👍 1