-
Notifications
You must be signed in to change notification settings - Fork 179
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
Implement test timeouts #647
Conversation
@@ -49,14 +51,23 @@ kotlin { | |||
|
|||
linuxMain { | |||
dependsOn nativeMain | |||
dependencies { | |||
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core-native:1.1.1' |
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.
dependencies.gradle
does not work here for some reason.
integration-test/src/jvmTest/kotlin/org/spekframework/spek2/integration/TimeoutTest.kt
Show resolved
Hide resolved
@@ -15,6 +15,7 @@ pluginManagement { | |||
} | |||
|
|||
enableFeaturePreview('STABLE_PUBLISHING') | |||
enableFeaturePreview('GRADLE_METADATA') |
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.
required by the coroutines library.
While debugging, I'm not able to take my time as this timeout occurs. I'm using the Gherkin method, so where can I override the timeout? And isn't there a way to set the timeout globally? |
@boylenssen just filed #692 and will be included in |
val test = TestScopeImpl( | ||
idFor(description), | ||
root.path.resolve(description), | ||
root, | ||
defaultTimeout, |
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.
you want to use the argument here instead
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.
yep, already fixed in master.
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.
so I have this:
class ResponseTest : Spek({
setArchTaskExecutor()
timeout(15000)
but that doesn't work. How to I set it?
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.
defaultTimeout = xxx
Resolves #643
An optional timeout parameter is added to
test
scope builder which defaults to 10 seconds. Timeout is implemented using coroutines under the hood, this means that timeout is not working on KN (only a single threaded coroutine is supported). Also, note that timeouts do not apply tobeforeGroup
,afterGroup
andafterEachTest
.