-
Notifications
You must be signed in to change notification settings - Fork 680
commonize shouldCompleteWithin/shouldCompleteBetween/shouldTimeout #4115
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
Conversation
- Convert timeout assertions to common Kotlin - Deprecate the JVM only versions - Update tests to use virtual time
…lete # Conflicts: # kotest-assertions/kotest-assertions-core/src/jvmMain/kotlin/io/kotest/matchers/concurrent/suspension/concurrent.kt
Hmmmm JVM tests work, but WasmJS fails
|
Seems like |
I found a similar issue on Slack https://slack-chats.kotlinlang.org/t/18859293/is-there-special-config-required-to-run-tests-with-wasmjs-i-, but the suggested workaround didn't help https://youtrack.jetbrains.com/issue/KT-67468 |
I got some help and we figured out the problem: the Kotest Gradle Plugin isn't applied to Kotest projects, so the tests can't be discovered or launched. |
Why does this lead to the timeout? I'd expect it the test run to finish on |
The test times out because the dependency Lines 73 to 79 in 2f9215c
The Kotlin test framework crashes as it tries to call the function on the headless browser before it could launch the test framework. Karma loses its patience and complains after 30 seconds without any response. |
That's correct, any JS platform test (including Kotest effectively does not fully self-test on non-JVM targets anyway due to the missing Kotest compiler plugin. While it appears to run non-JVM tests, without the plugin in place, test discovery actually does not take place. This could be corrected, but would require our build scripts to use the build's own version of the Kotest compiler plugin. A previous compiler plugin version from a repo could be chosen, but this would be unstable in case of incompatible changes in the code generated by the plugin. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, but added a couple of questions for things I don't understand
...assertions-core/src/commonMain/kotlin/io/kotest/matchers/concurrent/suspension/concurrent.kt
Outdated
Show resolved
Hide resolved
…out actual/expected results.
...assertions-core/src/commonMain/kotlin/io/kotest/matchers/concurrent/suspension/concurrent.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
shouldTimeout
, which is present in bothkotest-assertions
andkotest-assertions
kotest/kotest-assertions/kotest-assertions-core/src/jvmMain/kotlin/io/kotest/matchers/concurrent/suspension/concurrent.kt
Line 69 in cff27c5
kotest/kotest-assertions/kotest-assertions-shared/src/jvmMain/kotlin/io/kotest/assertions/async/timeout.kt
Line 9 in cff27c5