Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-49046

WithTimeout Annotation does not work

    Details

    • Similar Issues:

      Description

      @WithTimeout does not work as expected. It will only affect the error text ("Test timed out (after 2 seconds)") rather than the timing of the test itself.

      eg, using the following test:

      public class WithTimeoutTest {
      
          @Rule
          public JenkinsRule jenkinsRule = new JenkinsRule();
      
          @WithTimeout(1)
          @Test
          public void testFailsAfter1Second() throws InterruptedException {
              Thread.sleep(181_000);
          }
      }

      Expected Result:

      • Test failed after 1 second.
      • log message: "Test timed out (after 5 seconds)".

      Actual Result:

      • Test failed after 180 seconds (JenkinsRule default)
      • log message: "Test timed out (after 5 seconds)".

        Attachments

          Activity

          agentgonzo Steve Arch created issue -
          jglick Jesse Glick made changes -
          Field Original Value New Value
          Labels test-harness
          olivergondza Oliver Gondža made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          olivergondza Oliver Gondža made changes -
          Status In Progress [ 3 ] In Review [ 10005 ]
          jglick Jesse Glick made changes -
          Status In Review [ 10005 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]

            People

            • Assignee:
              olivergondza Oliver Gondža
              Reporter:
              agentgonzo Steve Arch
            • Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: