Skip to content
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

Rollback runTest timeout to 60 seconds, configure it with getenv #3945

Merged
merged 2 commits into from
Nov 30, 2023

Conversation

dkhalanskyjb
Copy link
Contributor

@dkhalanskyjb dkhalanskyjb commented Nov 20, 2023

This PR attempts to fix #3800.
The first part of the fix, reverting the timeout to 60 seconds, is successful.
The second part, allowing global configuration, not so much.

On JVM, Native, and Node JS, it's possible to use environment variables to communicate data to the process, and it could in theory be the solution, but it doesn't seem to interoperate well with Gradle.

The best attempt so far was to use this:

tasks.withType(AbstractTestTask::class).all {
    if (this is ProcessForkOptions) {
        environment("kotlinx.coroutines.test.default_timeout", "1ms")
    }
}

Unfortunately, only jvmTest implements ProcessForkOptions.

Without a clear way to configure the runTest timeout in Gradle builds, we can't claim that this is a proper solution.

This commit attempts to fix #3800.
The first part of the fix, reverting the timeout to 60 seconds, is
successful.
The second part, allowing global configuration, not so much.

On JVM, Native, and Node JS, it's possible to use environment
variables to communicate data to the process, and it could in
theory be the solution, but it doesn't seem to interoperate well
with Gradle.

The best attempt so far was to use this:
```kotlin
tasks.withType(AbstractTestTask::class).all {
    if (this is ProcessForkOptions) {
        environment("kotlinx.coroutines.test.default_timeout", "1ms")
    }
}
```

Unfortunately, only `jvmTest` implements `ProcessForkOptions`.

Without a clear way to configure the `runTest` timeout in Gradle
builds, we can't claim that this is a proper solution.
@dkhalanskyjb dkhalanskyjb force-pushed the dk-runTest-configurable-global-timeout branch from bd34f55 to a774899 Compare November 27, 2023 14:56
@dkhalanskyjb
Copy link
Contributor Author

It looks like there is no satisfactory answer so far for any platforms other than JVM. If we merge this JVM-only solution, I'll file an issue to support this on the other platforms.

@dkhalanskyjb dkhalanskyjb marked this pull request as ready for review November 27, 2023 14:58
@dkhalanskyjb dkhalanskyjb merged commit 9a98eab into develop Nov 30, 2023
1 check passed
@dkhalanskyjb dkhalanskyjb deleted the dk-runTest-configurable-global-timeout branch November 30, 2023 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants