New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests have huge delay, and "Default test timeout: 600000ms" shows #1355
Comments
On the SO message you linked, @sksamuel answered:
Could you try to do that and see if things work? My suggestion would be to try to migrate to a newer gradle version and ensure that IntelliJ actually is using the new version, via a sync or an invalidate/restart |
Looks like he tried 6.3 as well but this issue is usually caused by gradle
5 bugs
…On Sun, 5 Apr 2020, 15:56 Leonardo Colman Lopes, ***@***.***> wrote:
On the SO message you linked, @sksamuel <https://github.com/sksamuel>
answered:
If you're using gradle < 6, set a system property called
kotest.gradle5.compatibility=true and make sure you're using 4.0.2. This is
a workaround for a bug in gradle 5.x
Could you try to do that and see if things work?
My suggestion would be to try to migrate to a newer gradle version
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1355 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVSGWYU74LEV26HTO4AOTRLDV7BANCNFSM4MBMNP7A>
.
|
Many times IntelliJ/Android Studio just don't sync the project for some unknown reason. That's why I suggested ensuring it's actually using gradle 6 |
I just tried Gradle 6.3 again, by using this line in gradle-wrapper.properties:
I then did a manual sync and invalidated caches (and restarted), but the problem continues.
Sorry, I am really awful at Gradle stuff. How do I set this property? |
I just switched back to Gradle 5.6.4 and then added the line
|
Are you guys able to reproduce this? Is there anything else I can try? I simply cannot use Kotest without a huge delay before the tests run. I'm not sure exactly why, and this is my first ever time trying Kotest. |
How long is the huge delay would you say ? |
It's around six seconds. |
How big is the project? It could be that it's taking 6 seconds to scan your
classpath for tests.
You can turn on KOTEST_DEBUG=true ENV var to see output from that.
…On Thu, 9 Apr 2020 at 20:42, tom-jb ***@***.***> wrote:
It's around six seconds.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1355 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVSGWALLWLFJK6SWRGUYTRLZ2RBANCNFSM4MBMNP7A>
.
|
This happens in a brand new project in Android Studio. There is almost no code. I'll try setting the debug variable tomorrow; I'm not at a computer right now, unfortunately. |
Ok really strange. It probably scans the included jars too. We can easily
exclude common android jars.
…On Fri, 10 Apr 2020 at 00:54, tom-jb ***@***.***> wrote:
This happens in a brand new project in Android Studio. There is almost no
code.
I'll try setting the debug variable tomorrow; I'm not at a computer right
now, unfortunately.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1355 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVSGU2UDXKHTUO3KYZGZ3RL2YCNANCNFSM4MBMNP7A>
.
|
Okay, I set (Note that I didn't see any output until after the long delay. The Android Studio 'Run' tool window just shows "Instantiating tests..." for several seconds, and there is no output during this time.)
Here is the test code again: class MyTests : StringSpec({
"length should return size of string" {
"hello".length shouldBe 5
}
"startsWith should test for a prefix" {
"world" should startWith("wor")
}
}) |
Thanks for doing that. It seems that the full output was missed. Perhaps that flag was only active for the run task. Can you add that same KOTEST_DEBUG as an env to the entire build, and make sure you're running without gradle cache enabled. Once I can see the full output I should know what is taking so long. |
Sorry, could you tell me how to set KOTEST_DEBUG for the entire build? I tried googling but cannot figure it out. |
Are you running at the command line via gradle ?
…On Fri, 10 Apr 2020 at 23:22, tom-jb ***@***.***> wrote:
Sorry, could you tell me how to set KOTEST_DEBUG for the entire build? I
tried googling but cannot figure it out.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1355 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVSGWNB3UKM72C67K5KJLRL7V6TANCNFSM4MBMNP7A>
.
|
I'm running via Android Studio, though I could run via the command line as well. |
It's just easier to debug that way.
so in your terminal
export KOTEST_DEBUG=true
gradle check
or
./gradlew check
…On Fri, 10 Apr 2020 at 23:34, tom-jb ***@***.***> wrote:
I'm running via Android Studio, though I could run via the command line as
well.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1355 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVSGUGOMEBD5NH2X4OMGLRL7XMHANCNFSM4MBMNP7A>
.
|
Okay, I've tried this, but setting KOTEST_DEBUG doesn't seem to change the output in build/test-results/testDebugUnitTest/TEST-com.example.MyTests, which is always this:
This also seems to be the same as the previous output. Also, the delay doesn't appear to be happening when running from the command line, which suggests a problem with Android Studio, but then I've run several testing libraries in Android Studio without this problem. It's only Kotest that has this big delay. |
My guess is that it's slow because it's scanning for test files and your
android class path has some huge jars. The debugging would show me
something like:
"Scan discovered 23424 classes in the classpaths...
So I can see how many it is finding to see if I'm correct.
But there should be a ton more logging in general.
…On Fri, 10 Apr 2020 at 23:54, tom-jb ***@***.***> wrote:
Okay, I've tried this, but setting KOTEST_DEBUG doesn't seem to change the
output in build/test-results/testDebugUnitTest/TEST-com.example.MyTests,
which is always this:
invokeBeforeAll
~~~ Kotest Configuration ~~~
-> Parallelism: 1 thread(s)
-> Default test timeout: 600000ms
-> Default test order: TestCaseOrder
-> Default isolation mode: IsolationMode
-> Global soft assertations: False
-> Write spec failure file: False
-> Fail on ignored tests: False
-> Spec execution order: LexicographicSpecExecutionOrder
-> Extensions
- io.kotest.core.extensions.SystemPropertyTagExtension
- io.kotest.core.extensions.RuntimeTagExtension
- io.kotest.core.extensions.IgnoredSpecDiscoveryExtension
- io.kotest.core.extensions.TagFilteredDiscoveryExtension
Submitting 1 specs
Waiting for spec execution to terminate
Spec executor has terminated null
Waiting for spec execution to terminate
Executing spec class com.example.MyTests
Executing engine listener callback:specStarted class com.example.MyTests
Executing notifyPrepareSpec
Executing engine listener callback:specInstantiated ***@***.***
invokeBeforeSpec ***@***.***
Materialized roots: [RootTest(testCase=TestCase(description=Description(parents=[com.example.MyTests], name=length should return size of string), ***@***.***, test=io.kotest.core.test.TestContext.() -> kotlin.Unit, source=SourceRef(lineNumber=15, fileName=RandomExpressionGeneratorTests.kt), type=Test, config=TestCaseConfig(enabled=true, invocations=1, threads=1, timeout=null, tags=[], listeners=[], extensions=[], enabledIf=(io.kotest.core.test.TestCase) -> kotlin.Boolean), factoryId=null, assertionMode=null), order=0), RootTest(testCase=TestCase(description=Description(parents=[com.example.MyTests], name=startsWith should test for a prefix), ***@***.***, test=io.kotest.core.test.TestContext.() -> kotlin.Unit, source=SourceRef(lineNumber=18, fileName=RandomExpressionGeneratorTests.kt), type=Test, config=TestCaseConfig(enabled=true, invocations=1, threads=1, timeout=null, tags=[], listeners=[], extensions=[], enabledIf=(io.kotest.core.test.TestCase) -> kotlin.Boolean), factoryId=null, assertionMode=null), order=1)]
Executing test RootTest(testCase=TestCase(description=Description(parents=[com.example.MyTests], name=length should return size of string), ***@***.***, test=io.kotest.core.test.TestContext.() -> kotlin.Unit, source=SourceRef(lineNumber=15, fileName=RandomExpressionGeneratorTests.kt), type=Test, config=TestCaseConfig(enabled=true, invocations=1, threads=1, timeout=null, tags=[], listeners=[], extensions=[], enabledIf=(io.kotest.core.test.TestCase) -> kotlin.Boolean), factoryId=null, assertionMode=null), order=0)
Executing active test TestCase(description=Description(parents=[com.example.MyTests], name=length should return size of string), ***@***.***, test=io.kotest.core.test.TestContext.() -> kotlin.Unit, source=SourceRef(lineNumber=15, fileName=RandomExpressionGeneratorTests.kt), type=Test, config=TestCaseConfig(enabled=true, invocations=1, threads=1, timeout=null, tags=[], listeners=[], extensions=[], enabledIf=(io.kotest.core.test.TestCase) -> kotlin.Boolean), factoryId=null, assertionMode=null)
invokeTestCase TestCase(description=Description(parents=[com.example.MyTests], name=length should return size of string), ***@***.***, test=io.kotest.core.test.TestContext.() -> kotlin.Unit, source=SourceRef(lineNumber=15, fileName=RandomExpressionGeneratorTests.kt), type=Test, config=TestCaseConfig(enabled=true, invocations=1, threads=1, timeout=null, tags=[], listeners=[], extensions=[], enabledIf=(io.kotest.core.test.TestCase) -> kotlin.Boolean), factoryId=null, assertionMode=null)
Scheduler will interrupt this execution in 600sms
Test completed with result TestResult(status=Success, error=null, reason=null, duration=91.9ms)
Executing test RootTest(testCase=TestCase(description=Description(parents=[com.example.MyTests], name=startsWith should test for a prefix), ***@***.***, test=io.kotest.core.test.TestContext.() -> kotlin.Unit, source=SourceRef(lineNumber=18, fileName=RandomExpressionGeneratorTests.kt), type=Test, config=TestCaseConfig(enabled=true, invocations=1, threads=1, timeout=null, tags=[], listeners=[], extensions=[], enabledIf=(io.kotest.core.test.TestCase) -> kotlin.Boolean), factoryId=null, assertionMode=null), order=1)
Executing active test TestCase(description=Description(parents=[com.example.MyTests], name=startsWith should test for a prefix), ***@***.***, test=io.kotest.core.test.TestContext.() -> kotlin.Unit, source=SourceRef(lineNumber=18, fileName=RandomExpressionGeneratorTests.kt), type=Test, config=TestCaseConfig(enabled=true, invocations=1, threads=1, timeout=null, tags=[], listeners=[], extensions=[], enabledIf=(io.kotest.core.test.TestCase) -> kotlin.Boolean), factoryId=null, assertionMode=null)
invokeTestCase TestCase(description=Description(parents=[com.example.MyTests], name=startsWith should test for a prefix), ***@***.***, test=io.kotest.core.test.TestContext.() -> kotlin.Unit, source=SourceRef(lineNumber=18, fileName=RandomExpressionGeneratorTests.kt), type=Test, config=TestCaseConfig(enabled=true, invocations=1, threads=1, timeout=null, tags=[], listeners=[], extensions=[], enabledIf=(io.kotest.core.test.TestCase) -> kotlin.Boolean), factoryId=null, assertionMode=null)
Scheduler will interrupt this execution in 600sms
Test completed with result TestResult(status=Success, error=null, reason=null, duration=11.8ms)
invokeAfterSpec ***@***.***
Executing notifyFinalizeSpec
Executing engine listener callback:specFinished class com.example.MyTests
Spec executor has terminated null
invokeAfterAll
This also seems to be the same as the previous output.
Also, the delay doesn't appear to be happening when running from the
command line, which suggests a problem with Android Studio, but then I've
run several testing libraries in Android Studio without this problem. It's
only Kotest that has this big delay.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1355 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVSGXLP2EJ6LF3ZFRDU3LRL7ZYBANCNFSM4MBMNP7A>
.
|
I wish I could help more. :( I wonder whether there is a way of setting this variable for the whole build within Android Studio? I tried searching for a way to set it in build.gradle, but nothing seems to work. |
Create a gradle.properties file in the root of your project (or use the
existing one) and add systemProp.KOTEST_DEBUG=true
Then try running your project as normal (do a clean first).
http://sorcersoft.org/project/site/gradle/userguide/tutorial_this_and_that.html
…On Sat, 11 Apr 2020 at 00:35, tom-jb ***@***.***> wrote:
I wish I could help more. :(
I wonder whether there is a way of setting this variable for the whole
build within Android Studio? I tried searching for a way to set it in
build.gradle, but nothing seems to work.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1355 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVSGURFVNEPUEJCH43V23RL76RPANCNFSM4MBMNP7A>
.
|
Thanks. Unfortunately, that only shows the usual "Configuration" message in the 'Run' window in Android Studio:
I can't see any other output. |
Okay, I recreated that Gradle 'check' task exactly as in your screenshot, but unfortunately I still don't see any mention of the word 'Scan':
|
You're on windows?
…On Sat, 11 Apr 2020, 01:18 tom-jb, ***@***.***> wrote:
Okay, I recreated that Gradle 'check' task exactly as in your screenshot,
but unfortunately I still don't see any mention of the word 'Scan':
Testing started at 07:09 ...
Executing tasks: [check] in project C:\Test\app
> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:compileDebugAidl NO-SOURCE
> Task :app:compileDebugRenderscript NO-SOURCE
> Task :app:dataBindingMergeDependencyArtifactsDebug UP-TO-DATE
> Task :app:generateDebugResValues UP-TO-DATE
> Task :app:generateDebugResources UP-TO-DATE
> Task :app:generateDebugBuildConfig UP-TO-DATE
> Task :app:dataBindingMergeGenClassesDebug UP-TO-DATE
> Task :app:mergeDebugResources UP-TO-DATE
> Task :app:dataBindingGenBaseClassesDebug UP-TO-DATE
> Task :app:mainApkListPersistenceDebug UP-TO-DATE
> Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
> Task :app:extractDeepLinksDebug UP-TO-DATE
> Task :app:preReleaseBuild UP-TO-DATE
> Task :app:compileReleaseAidl NO-SOURCE
> Task :app:processDebugManifest UP-TO-DATE
> Task :app:processDebugResources UP-TO-DATE
> Task :app:compileDebugKotlin UP-TO-DATE
> Task :app:javaPreCompileDebug UP-TO-DATE
> Task :app:compileDebugJavaWithJavac UP-TO-DATE
> Task :app:compileReleaseRenderscript NO-SOURCE
> Task :app:dataBindingMergeDependencyArtifactsRelease UP-TO-DATE
> Task :app:dataBindingMergeGenClassesRelease UP-TO-DATE
> Task :app:generateReleaseResValues UP-TO-DATE
> Task :app:generateReleaseResources UP-TO-DATE
> Task :app:mergeReleaseResources UP-TO-DATE
> Task :app:dataBindingGenBaseClassesRelease UP-TO-DATE
> Task :app:generateReleaseBuildConfig UP-TO-DATE
> Task :app:mainApkListPersistenceRelease UP-TO-DATE
> Task :app:createReleaseCompatibleScreenManifests UP-TO-DATE
> Task :app:extractDeepLinksRelease UP-TO-DATE
> Task :app:processReleaseManifest UP-TO-DATE
> Task :app:processReleaseResources UP-TO-DATE
> Task :app:compileReleaseKotlin UP-TO-DATE
> Task :app:javaPreCompileRelease UP-TO-DATE
> Task :app:compileReleaseJavaWithJavac UP-TO-DATE
> Task :app:prepareLintJar UP-TO-DATE
> Task :app:lint
Ran lint on variant debug: 0 issues found
Ran lint on variant release: 0 issues found
Wrote HTML report to file:///C:/Test/app/build/reports/lint-results.html
Wrote XML report to file:///C:/Test/app/build/reports/lint-results.xml
> Task :app:compileDebugUnitTestKotlin
> Task :app:preDebugUnitTestBuild UP-TO-DATE
> Task :app:processDebugJavaRes NO-SOURCE
> Task :app:processDebugUnitTestJavaRes NO-SOURCE
> Task :app:compileReleaseUnitTestKotlin
> Task :app:preReleaseUnitTestBuild UP-TO-DATE
> Task :app:javaPreCompileDebugUnitTest
> Task :app:compileDebugUnitTestJavaWithJavac NO-SOURCE
> Task :app:testDebugUnitTest
invokeBeforeAll
~~~ Kotest Configuration ~~~
-> Parallelism: 1 thread(s)
-> Default test timeout: 600000ms
-> Default test order: TestCaseOrder
-> Default isolation mode: IsolationMode
-> Global soft assertations: False
-> Write spec failure file: False
-> Fail on ignored tests: False
-> Spec execution order: LexicographicSpecExecutionOrder
-> Extensions
- io.kotest.core.extensions.SystemPropertyTagExtension
- io.kotest.core.extensions.RuntimeTagExtension
- io.kotest.core.extensions.IgnoredSpecDiscoveryExtension
- io.kotest.core.extensions.TagFilteredDiscoveryExtension
Submitting 1 specs
Waiting for spec execution to terminate
Spec executor has terminated null
Waiting for spec execution to terminate
Executing spec class com.example.MyTests
Executing engine listener callback:specStarted class com.example.MyTests
Executing notifyPrepareSpec
Executing engine listener callback:specInstantiated ***@***.***
invokeBeforeSpec ***@***.***
Materialized roots: [RootTest(testCase=TestCase(description=Description(parents=[com.example.MyTests], name=length should return size of string), ***@***.***, test=io.kotest.core.test.TestContext.() -> kotlin.Unit, source=SourceRef(lineNumber=15, fileName=RandomExpressionGeneratorTests.kt), type=Test, config=TestCaseConfig(enabled=true, invocations=1, threads=1, timeout=null, tags=[], listeners=[], extensions=[], enabledIf=(io.kotest.core.test.TestCase) -> kotlin.Boolean), factoryId=null, assertionMode=null), order=0), RootTest(testCase=TestCase(description=Description(parents=[com.example.MyTests], name=startsWith should test for a prefix), ***@***.***, test=io.kotest.core.test.TestContext.() -> kotlin.Unit, source=SourceRef(lineNumber=18, fileName=RandomExpressionGeneratorTests.kt), type=Test, config=TestCaseConfig(enabled=true, invocations=1, threads=1, timeout=null, tags=[], listeners=[], extensions=[], enabledIf=(io.kotest.core.test.TestCase) -> kotlin.Boolean), factoryId=null, assertionMode=null), order=1)]
Executing test RootTest(testCase=TestCase(description=Description(parents=[com.example.MyTests], name=length should return size of string), ***@***.***, test=io.kotest.core.test.TestContext.() -> kotlin.Unit, source=SourceRef(lineNumber=15, fileName=RandomExpressionGeneratorTests.kt), type=Test, config=TestCaseConfig(enabled=true, invocations=1, threads=1, timeout=null, tags=[], listeners=[], extensions=[], enabledIf=(io.kotest.core.test.TestCase) -> kotlin.Boolean), factoryId=null, assertionMode=null), order=0)
Executing active test TestCase(description=Description(parents=[com.example.MyTests], name=length should return size of string), ***@***.***, test=io.kotest.core.test.TestContext.() -> kotlin.Unit, source=SourceRef(lineNumber=15, fileName=RandomExpressionGeneratorTests.kt), type=Test, config=TestCaseConfig(enabled=true, invocations=1, threads=1, timeout=null, tags=[], listeners=[], extensions=[], enabledIf=(io.kotest.core.test.TestCase) -> kotlin.Boolean), factoryId=null, assertionMode=null)
invokeTestCase TestCase(description=Description(parents=[com.example.MyTests], name=length should return size of string), ***@***.***, test=io.kotest.core.test.TestContext.() -> kotlin.Unit, source=SourceRef(lineNumber=15, fileName=RandomExpressionGeneratorTests.kt), type=Test, config=TestCaseConfig(enabled=true, invocations=1, threads=1, timeout=null, tags=[], listeners=[], extensions=[], enabledIf=(io.kotest.core.test.TestCase) -> kotlin.Boolean), factoryId=null, assertionMode=null)
Scheduler will interrupt this execution in 600sms
Test completed with result TestResult(status=Success, error=null, reason=null, duration=52.8ms)
Executing test RootTest(testCase=TestCase(description=Description(parents=[com.example.MyTests], name=startsWith should test for a prefix), ***@***.***, test=io.kotest.core.test.TestContext.() -> kotlin.Unit, source=SourceRef(lineNumber=18, fileName=RandomExpressionGeneratorTests.kt), type=Test, config=TestCaseConfig(enabled=true, invocations=1, threads=1, timeout=null, tags=[], listeners=[], extensions=[], enabledIf=(io.kotest.core.test.TestCase) -> kotlin.Boolean), factoryId=null, assertionMode=null), order=1)
Executing active test TestCase(description=Description(parents=[com.example.MyTests], name=startsWith should test for a prefix), ***@***.***, test=io.kotest.core.test.TestContext.() -> kotlin.Unit, source=SourceRef(lineNumber=18, fileName=RandomExpressionGeneratorTests.kt), type=Test, config=TestCaseConfig(enabled=true, invocations=1, threads=1, timeout=null, tags=[], listeners=[], extensions=[], enabledIf=(io.kotest.core.test.TestCase) -> kotlin.Boolean), factoryId=null, assertionMode=null)
invokeTestCase TestCase(description=Description(parents=[com.example.MyTests], name=startsWith should test for a prefix), ***@***.***, test=io.kotest.core.test.TestContext.() -> kotlin.Unit, source=SourceRef(lineNumber=18, fileName=RandomExpressionGeneratorTests.kt), type=Test, config=TestCaseConfig(enabled=true, invocations=1, threads=1, timeout=null, tags=[], listeners=[], extensions=[], enabledIf=(io.kotest.core.test.TestCase) -> kotlin.Boolean), factoryId=null, assertionMode=null)
Scheduler will interrupt this execution in 600sms
Test completed with result TestResult(status=Success, error=null, reason=null, duration=36.9ms)
invokeAfterSpec ***@***.***
Executing notifyFinalizeSpec
Executing engine listener callback:specFinished class com.example.MyTests
Spec executor has terminated null
invokeAfterAll
> Task :app:processReleaseJavaRes NO-SOURCE
> Task :app:processReleaseUnitTestJavaRes NO-SOURCE
> Task :app:javaPreCompileReleaseUnitTest
> Task :app:compileReleaseUnitTestJavaWithJavac NO-SOURCE
> Task :app:testReleaseUnitTest UP-TO-DATE
> Task :app:test
> Task :app:check
BUILD SUCCESSFUL in 13s
36 actionable tasks: 6 executed, 30 up-to-date
07:09:58: Task execution finished 'check'.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1355 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVSGVO2KCN6YOUMBWQBZDRMADTJANCNFSM4MBMNP7A>
.
|
Yeah, Windows 10. |
Wanted to add a partial +1 to this. Same setup here - Windows 10, android studio, Kotest 4.0.2, gradle 5.6.4 I ugraded to gradle 6.3 after reading that SO post, but it hasn't made any noticable difference. |
The problem with gradle 5 is that it stops your build entirely, so isn't
the cause on this.
My best guess is that classpath takes a long time to scan the jars on
windows.
…On Sun, 12 Apr 2020 at 10:50, Oliver Culley de Lange < ***@***.***> wrote:
Wanted to add a partial +1 to this.
Same setup here - Windows 10, android studio, Kotest 4.0.2, gradle 5.6.4
I get the same ~5 - 6 seconds delay before tests actually run where
android studio says Instantiating tests.... However i do actually get the
tests to run and they pass/fail accordingly.
I ugraded to gradle 6.3 after reading that SO post, but it hasn't made any
noticable difference.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1355 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVSGTG2OFM25ZHAX7SNC3RMHPLPANCNFSM4MBMNP7A>
.
|
I don't know if it's related to this
classgraph/classgraph#390
…On Sun, 12 Apr 2020 at 10:57, Stephen Samuel (Sam) ***@***.***> wrote:
The problem with gradle 5 is that it stops your build entirely, so isn't
the cause on this.
My best guess is that classpath takes a long time to scan the jars on
windows.
On Sun, 12 Apr 2020 at 10:50, Oliver Culley de Lange <
***@***.***> wrote:
> Wanted to add a partial +1 to this.
>
> Same setup here - Windows 10, android studio, Kotest 4.0.2, gradle 5.6.4
> I get the same ~5 - 6 seconds delay before tests actually run where
> android studio says Instantiating tests.... However i do actually get
> the tests to run and they pass/fail accordingly.
>
> I ugraded to gradle 6.3 after reading that SO post, but it hasn't made
> any noticable difference.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#1355 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAFVSGTG2OFM25ZHAX7SNC3RMHPLPANCNFSM4MBMNP7A>
> .
>
|
Yes, the same applies to me. The tests run fine and pass; the only problem is that I see "Instantiating tests…" for several seconds before every run. |
Do you want to try a snapshot build?
I've released 4.1.0.225-SNAPSHOT which has the latest classgraph library.
…On Sun, 12 Apr 2020 at 11:55, tom-jb ***@***.***> wrote:
However i do actually get the tests to run and they pass/fail accordingly.
Yes, the same applies to me. The tests run fine and pass; the only problem
is that I see "Instantiating tests…" for several seconds before every run.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1355 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVSGQX5XPH2X3NIPAQL2DRMHW7RANCNFSM4MBMNP7A>
.
|
Bit of a strange result, with the new version, my test files aren't recognised as test files anymore and can't be 'run' so i can't compare run times in Android Studio. |
That's because of an unrelated change. Sorry I forget you're only running
this in intellij.
It's fine if you use gradle right.
…On Sun, 12 Apr 2020 at 14:06, Oliver Culley de Lange < ***@***.***> wrote:
Bit of a strange result, with the new version, my test files aren't
recognised as test files anymore and can't be 'run' so i can't compare run
times in Android Studio.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1355 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVSGXXM2U3PYJFI4LBA6DRMIGL5ANCNFSM4MBMNP7A>
.
|
Its hard to compare, as i don't use gradle to run testsas its much more convenient to run through Android Studio if i'm running a subset of tests for example. |
When I try the following, I get 'ERROR: Failed to resolve' on both lines: testImplementation 'io.kotest:kotest-runner-junit4-jvm:4.1.0.225-SNAPSHOT' // for kotest framework
testImplementation 'io.kotest:kotest-assertions-core-jvm:4.1.0.225-SNAPSHOT' // for kotest core jvm assertions However, like Oliver, I run tests from Android Studio anyway. And as far as I can tell this delay happens only when I run from Android Studio. On the other hand, I did just try Kotlintest 3.4.2, and I found that the delay there is much shorter. Rather than seeing "Instantiating tests…" for about six seconds, I see it for about two seconds instead. This is still longer than I see it with plain JUnit, where I see "Instantiating tests…" for less than a second, but it is much quicker than with Kotest 4. |
The reason it can't find those deps is because you need to add sonatype
snapshots repository to your build. Snapshot builds are never on maven
central but on https://oss.sonatype.org/content/repositories/snapshots/
…On Sun, 12 Apr 2020 at 16:56, tom-jb ***@***.***> wrote:
When I try the following, I get 'ERROR: Failed to resolve' on both lines:
testImplementation 'io.kotest:kotest-runner-junit4-jvm:4.1.0.225-SNAPSHOT' // for kotest framework
testImplementation 'io.kotest:kotest-assertions-core-jvm:4.1.0.225-SNAPSHOT' // for kotest core jvm assertions
However, like Oliver, I run tests from Android Studio anyway. And as far
as I can tell this delay happens only when I run from Android Studio.
On the other hand, I did just try Kotlintest 3.4.2, and I found that the
delay there is much shorter. Rather than seeing "Instantiating tests…" for
about six seconds, I see it for about two seconds instead.
This is still longer than I see it with plain JUnit, where I see
"Instantiating tests…" for less than a second, but it is much quicker than
with Kotest 4.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1355 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVSGSSNS5HZ2GEA6B64ZDRMI2JHANCNFSM4MBMNP7A>
.
|
Okay, I just added the Sonatype repository and tried 4.1.0.225-SNAPSHOT. I ran the tests in Android Studio, and they ran and passed, but the 6-second "Instantiating tests..." delay was still there. |
Thanks for trying that. I think that rules out classgraph just being slow in older versions. I am wondering if there are a ton of android libraries we can blacklist so they're never scanned for tests (like we do with java, javax, and so on). |
Awesome, we can wipe out androidx straight away.
I'll be releasing 4.0.3 tomorrow and I'll include this change in that.
Worst case is it makes no difference.
…On Mon, 13 Apr 2020 at 22:33, tom-jb ***@***.***> wrote:
Okay, here it is:
<https://camo.githubusercontent.com/c7e89968c8cf2daecd69ff92b97f999609348d1a/68747470733a2f2f692e6962622e636f2f587a51327157782f73732e706e67>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1355 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVSGQDPCVZN6VD5QEBOPTRMPKPZANCNFSM4MBMNP7A>
.
|
Thanks, I'll try it straightaway. |
So I released 4.0.3 and forgot to include this change (it's only on
master). So can you try snapshot 4.1.0.245-SNAPSHOT which does have that
change.
If it solves the issue I'll release 4.0.4 with just that.
…On Mon, 13 Apr 2020 at 23:12, tom-jb ***@***.***> wrote:
Thanks, I'll try it straightaway.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1355 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVSGWHXAMOI4P4BMCGEOTRMPPC3ANCNFSM4MBMNP7A>
.
|
I'm trying 4.1.0.245-SNAPSHOT right now. It's telling me it can't find StringSpec (and FunSpec and so on). In the |
Okay, I fixed the above by changing "junit4" to "junit5" in the following: testImplementation 'io.kotest:kotest-runner-junit4-jvm:4.1.0.245-SNAPSHOT' Now the tests run and pass. However, the huge delay is still present. In fact, it seems slightly longer now (eight seconds instead of six seconds), but I could be mistaken about it being slightly longer. |
Ok so filtering out some packages didn't help.
I'm going to make a special build that contains more logging to try and get
to the bottom of this.
…On Wed, 15 Apr 2020 at 17:34, tom-jb ***@***.***> wrote:
Okay, I fixed the above by changing "junit4" to "junit5" in the following:
testImplementation 'io.kotest:kotest-runner-junit4-jvm:4.1.0.245-SNAPSHOT'
Now the tests run and pass. However, the huge delay is still present. In
fact, it seems slightly longer now (eight seconds instead of six seconds),
but I could be mistaken about it being slightly longer.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1355 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVSGXKKTDTULG5UFDP6OTRMYY53ANCNFSM4MBMNP7A>
.
|
Did we ever get closer to solving this ? |
4.1.0 is out if you want to try that. |
Can you try setting kotest debug using export?
…On Sat, 4 Jul 2020 at 07:15, klesniewski ***@***.***> wrote:
I experience similar issue, although with non-Android, plain Kotlin/JVM
project. From running the test task to executing first test it takes around
12 seconds, where it takes 6 seconds before it starts executing spec and
then another 6 seconds before running the first test in the spec. The last
number is surely affected by starting a Postgres container using
TestContainers.
I experience the problem with Kotest 4.0.2 and it is still there after
upgrading to Kotest 4.1.1.
OS: Windows 10 x64
JVM: 14
Gradle: 6.3
Kotlin: 1.3.71
Kotest: 4.1.1
Here is a recording from test run:
[image: kotest-slow-init]
<https://user-images.githubusercontent.com/6713429/86512216-68750b80-be00-11ea-8271-6592bf08c0b5.gif>
You can also see I set KOTEST_DEBUG env var, but I don't see any
additional output. I tried the same in IntelliJ also without result. Any
ideas how can I gather more details on the problem?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1355 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVSGXI42OP7QIWUHO6VM3RZ4MNZANCNFSM4MBMNP7A>
.
|
There's been some changes in architecture in the 4.2.x releases. Is this still happening on say 4.2.2 ? |
Seems like yes, still 600 seconds on 4.2.5 |
Similar issues with kotest 4.3.0 |
Can you try 4.3.1. I'm hoping #1788 has solved this. |
Looks like the issues are gone with 4.3.1 👍 |
Great. |
I'm trying Kotest for the first time (version 4.0.2). I created a new project in Android Studio 3.6.2, using Gradle 5.6.4. I added the basic example tests:
I ran the tests, and they passed, but they took several seconds to run. The following was printed in the Android Studio 'Run' window:
There is no exception message; just the above. I get the same output if I run
gradlew test
from the command line.I tried both the JUnit 5 runner and the JUnit 4 runner, with the same results each time. I also tried Gradle 6.3, with the same results.
The following SO question seems to be the same issue:
https://stackoverflow.com/questions/60351366/kotest-freezes-after-migrating-to-4-0-0-beta1-on-testdebugunittest-task
The text was updated successfully, but these errors were encountered: