Sample Tests in TestNG

Thanks to the library update (easymock 2.2 → 2.4), we have tests that started the lock. I would like to spend time on separate tests, and all of them. The idea is to identify the locked tests that we are now guessing and fix them.

Is this possible, preferably at the dial level? We have 400 tests, each of which performs each method, or even each class will take a lot of time.

+6
java multithreading testng
source share
4 answers

The tag may have a timeout attribute. This timeout will be used by default for all testing methods.

This default timeout can be overridden based on each testing method.

+5
source share

If the Suite level turns out to be wrong (that is, the network is too wide because you end up with too many methods with a timeout limit), you need to define a custom IAnnotationTransformer , which for each inaudible function will give you the opportunity to change the @ annotation Test (using, for example, setTimout () ).
( setTimout(0) cancels the timeout directive)

+2
source share

It's very late, but: running jstack -l <PID> will give you a dump of the stack, which you can check to find which calls are stuck. You can try several times to make sure they are stuck.

+2
source share

You can search and replace "@Test" with "@Test (timeout =)" Should work to find the locked test and can be canceled after that.

+1
source share

All Articles