Skip to content

Commit 164f1eb

Browse files
committed
Small changes to TimeoutExtension specs
1 parent 4787126 commit 164f1eb

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

spock-specs/src/test/groovy/org/spockframework/docs/timeout/TimeoutConfigurationDoc.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ package org.spockframework.docs.timeout
22

33
import org.spockframework.runtime.SpockTimeoutError
44
import org.spockframework.runtime.extension.builtin.ThreadDumpUtilityType
5+
import spock.lang.Isolated
56
import spock.timeout.BaseTimeoutExtensionSpecification
67

8+
@Isolated("The thread dump interferes with the parallel logging")
79
class TimeoutConfigurationDoc extends BaseTimeoutExtensionSpecification {
810

911
def "thread dump capturing respects provided configuration"() {

spock-specs/src/test/groovy/org/spockframework/smoke/extension/TimeoutExtension.groovy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ import static org.spockframework.runtime.model.parallel.ExecutionMode.SAME_THREA
3131
/**
3232
* @author Peter Niederwieser
3333
*/
34-
@Isolated("The timings are quite tight and it can get flaky on weak machines if run in parallel.")
35-
@Execution(SAME_THREAD)
34+
@Isolated("The timings are quite tight and it can get flaky on weak machines if run in parallel, and thread dumps interfere with other test output.")
3635
@Retry
3736
class TimeoutExtension extends BaseTimeoutExtensionSpecification {
3837
@Shared

spock-specs/src/test/groovy/spock/timeout/BaseTimeoutExtensionSpecification.groovy

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@ import org.spockframework.EmbeddedSpecification
44
import org.spockframework.runtime.IStandardStreamsListener
55
import org.spockframework.runtime.StandardStreamsCapturer
66
import org.spockframework.runtime.extension.builtin.ThreadDumpUtilityType
7+
import org.spockframework.runtime.model.parallel.Resources
78
import spock.lang.AutoCleanup
9+
import spock.lang.ResourceLock
810

911
import java.util.concurrent.TimeUnit
1012

13+
@ResourceLock(Resources.SYSTEM_OUT)
14+
@ResourceLock(Resources.SYSTEM_ERR)
1115
abstract class BaseTimeoutExtensionSpecification extends EmbeddedSpecification {
1216

1317
@AutoCleanup("stop")

0 commit comments

Comments
 (0)