question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tests have huge delay, and "Default test timeout: 600000ms" shows

See original GitHub issue

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:

class MyTests : StringSpec({
    "length should return size of string" {
        "hello".length shouldBe 5
    }
    "startsWith should test for a prefix" {
        "world" should startWith("wor")
    }
})

I ran the tests, and they passed, but they took several seconds to run. The following was printed in the Android Studio ‘Run’ window:

~~~ 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

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:55 (28 by maintainers)

github_iconTop GitHub Comments

2reactions
klesniewskicommented, Jul 4, 2020

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: kotest-slow-init

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?

1reaction
sksamuelcommented, Apr 15, 2020

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 notifications@github.com 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 https://github.com/kotest/kotest/issues/1355#issuecomment-614313216, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFVSGXKKTDTULG5UFDP6OTRMYY53ANCNFSM4MBMNP7A .

Read more comments on GitHub >

github_iconTop Results From Across the Web

For async tests and hooks, ensure "done()" is called
I know an ugly way of doing it, just by increasing default timeout of Mocha from 2 seconds to 10 seconds this can...
Read more >
Async Methods - Testing Library
Several utilities are provided for dealing with asynchronous code. ... disappear in response to an event, user action, timeout, or Promise.
Read more >
TcpDiscoverySpi (Ignite 2.14.0) - Apache Ignite
Default delay between attempts to connect to the cluster in milliseconds (value is ... Default SO_LINGER to set for socket, 0 means enabled...
Read more >
Waiting for Objects in Image-Based Tests - SmartBear Support
When testing an application, you may need to delay the test run until the needed object ... Image-Based Testing: Configuring the Auto-wait timeout...
Read more >
Setting up a collection-based monitor
By uploading a data file, you can run your tests with multiple sets of ... By default, each monitor run has a timeout...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found