WithTimeout Annotation and JenkinsRule timeout variable is not taking effect.

38 views
Skip to first unread message

Priya Pawar

unread,
Feb 9, 2018, 8:05:29 AM2/9/18
to Jenkins Developers
Hi,

We want to increase test case timeout value for Jenkins test harness
We tried to use both @WithTimeout annotation and JenkinsRule timeout variable to increase the timeout but both are not working. In both the cases test is getting timeout after 180 seconds.


public class TestClass {

    @Rule
    public JenkinsRule jenkinsRule = new JenkinsRule();

    @WithTimeout(1500)
    @Test
     public void test() throws Exception 
    {
      //Lines of code which are taking time
     }
}

This code is not taking effect at all. 

Log Message:

WARNING: Test timed out (after 180 seconds).

OR

public class TestClass {

    @Rule
    public JenkinsRule jenkinsRule = new JenkinsRule();

    public TestClass ()
{ jenkinsRule.timeout=1500; } @Test public void test() throws InterruptedException { Thread.sleep(181_000); } }

In this case value of seconds is just changing in log message only. Test is still failing in 180 seconds.

Log Message:

WARNING: Test timed out (after 1500 seconds).

Is there any other solution to increase test timeout??




Jesse Glick

unread,
Feb 9, 2018, 8:31:41 AM2/9/18
to Jenkins Dev
On Fri, Feb 9, 2018 at 1:49 PM, Priya Pawar <pawarp...@gmail.com> wrote:
> In this case value of seconds is just changing in log message only. Test is
> still failing in 180 seconds.

Possibly a bug. Please specify the version of `jenkins-test-harness`
you are using. There was a complete rewrite of the timeout support in

https://github.com/jenkinsci/jenkins-test-harness#225-2017-sep-12

sa...@cloudbees.com

unread,
Feb 9, 2018, 9:37:36 AM2/9/18
to Jenkins Developers
I've already filed a bug for this: https://issues.jenkins-ci.org/browse/JENKINS-49046

Priya Pawar

unread,
Feb 12, 2018, 3:53:48 AM2/12/18
to Jenkins Developers

jenkins-test-harness version 1.642
Reply all
Reply to author
Forward
0 new messages