Skip to content

Commit

Permalink
Disable timeouts by default (#882)
Browse files Browse the repository at this point in the history
  • Loading branch information
raniejade authored Apr 19, 2020
1 parent 943cda3 commit 005682a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ import org.spekframework.spek2.style.specification.describe

object TimeoutTest: AbstractSpekTest({ helper ->
describe("test timeouts") {
it("should timeout using default settings", timeout = 0) {
it("should not timeout using default settings", timeout = 0) {
val recorder = helper.executeTest(testData.timeoutTest.DefaultTimeoutTest)

helper.assertExecutionEquals(
recorder.events()
) {
group("DefaultTimeoutTest") {
test("should timeout", false)
test("should not timeout")
group("timeout specification style") {
test("should timeout", false)
test("should not timeout")
}
group("Feature: timeout gherkin style") {
group("Scenario: some scenario") {
test("Then: should timeout", false)
test("Then: should not timeout")
}
}
}
Expand Down Expand Up @@ -49,14 +49,14 @@ object TimeoutTest: AbstractSpekTest({ helper ->

describe("global timeouts") {
it("should use specified global timeout", timeout = 0) {
System.setProperty("SPEK_TIMEOUT", 15000L.toString())
System.setProperty("SPEK_TIMEOUT", 8000L.toString())
val recorder = helper.executeTest(testData.timeoutTest.GlobalTimeoutTest)

helper.assertExecutionEquals(
recorder.events()
) {
group("GlobalTimeoutTest") {
test("this should run for 10 seconds and pass since global timeout is 20")
test("this should run for 10 seconds and but fail since global timeout is 8 seconds", false)
}
}
System.clearProperty("SPEK_TIMEOUT")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ import org.spekframework.spek2.style.gherkin.Feature
import org.spekframework.spek2.style.specification.describe

object DefaultTimeoutTest: Spek({
test("should timeout") {
test("should not timeout") {
sleep(13000)
}

describe("timeout specification style") {
it("should timeout") {
it("should not timeout") {
sleep(13000)
}
}

Feature("timeout gherkin style") {
Scenario("some scenario") {
Then("should timeout") {
Then("should not timeout") {
sleep(13000)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package testData.timeoutTest
import org.spekframework.spek2.Spek

object GlobalTimeoutTest : Spek({
test("this should run for 10 seconds and pass since global timeout is 20") {
test("this should run for 10 seconds and but fail since global timeout is 8 seconds") {
sleep(10000)
}
})
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class SpekRuntime {
}

companion object {
private const val DEFAULT_TIMEOUT = 10000L
private const val DEFAULT_TIMEOUT = 0L
}
}

Expand Down

0 comments on commit 005682a

Please sign in to comment.