recently I was looking for a solution to apply test method timeout in arquillian in-container test. In the end I realized that test method timeout was not the right approach for my use case... though I figured out that it is not possible at the moment (see details below). I think it would be quite useful to have some similar feature in Arquillian core or Performance extension - filed an issue .
Now issues I ran into...
First I tried TestNG native test method timeout (using @Test(timeOut=xx)) but this corrupted arquillian test execution. Most probably because of unsupported thread execution needs. BTW JUnit test method timeout (@Test(timeout=xx)) fails the same way.
So I tried to use Performance extension. However it did not meet my requirements since it only checks whether the test finished within the specified time and DOES NOT terminate method execution in case of the timeout is exceeded. In other words my test would fail in the end but may also theoretically stuck forever. Moreover I found out that Performance extension does not work with TestNG at the moment - filed an issue .
Finally I realized I need something completely different :-) and created simple solution to generalize waiting logic for async operations - timer object that delays thread execution . Might be useful for someone :-)