How do I configure timeout for tests run using the Test task?


(Tim Fox) #1

How can I specify a test timeout (equivalent functionality to “timeout” in an ant junit task http://ant.apache.org/manual/Tasks/junit.html) when running Junit tests with the Gradle test task?


(Peter Niederwieser) #2

I’m not aware of an equivalent. You could use JUnit’s @Timeout or time out the build on the CI server.


(Tim Fox) #3

This seems like a glaring omission.

Setting @Timeout on each test is not practical.

If tests timeout, I don’t want to be sitting there for half an hour waiting for the test suite to complete so I can view the report.

Are there any plans for a better solution?

I saw this: http://issues.gradle.org/browse/GRADLE-1020?page=com.atlassian.jira.plugin.system.issuetabpanels:changehistory-tabpanel

Is it related?


(Peter Niederwieser) #4

From what I understand from the Ant docs, it does not time out individual tests, at least not when forking is used. GRADLE-1020 sounds related but doesn’t provide any details. Feel free to file a detailed feature request.