Rate This Document
Findability
Accuracy
Completeness
Readability

"assertTimeoutPreemptively" Contained in a Case and Execution Result Not "TimeoutException"

Symptom

The generated UT case contains the "assertTimeoutPreemptively" assertion. When the UT is running, exceptions not shown in 2 occur.

Figure 1 assertTimeoutPreemptively
Figure 2 Normal timeout

Possible Causes

The UTgen tool has been analyzing code for longer than the allowed time limit.

Troubleshooting Procedure

Add the option to the .idea/utgen-settings.xml file in the project folder.

<project version="4">
  <component name="UTgenSettings">
    ...
    <option name="hangingTestsTimeout" value="HangingTestsTimeout:1000" />
    ...
  </component>
</project>

Increase the HangingTestsTimeout value, which defaults to 1,000 ms.