One of my biggest issues when using JRunit for remoting tests is that sometimes messages, such as sending test results, do not get delivered to the JRunit driver class. This causes the driver to timeout thinking that the tests are hung and produce an error and kill the test.
JGroups is the framework used behind the MessageBus class which handles the messaging. I have been able to identify in the logging that the test result message is sent by the client test, but never consumed by the driver's MessageBus. I have tried different JGroups configurations, but can't seem to find one where this does not occasionally happen.
I have been unit testing jrunit itself and using my jrunit builds to unit test jboss-remoting. I am talking of the Linux case specifically.
TestDriver must be patched on Linux to include -Djava.net.preferIPv4Stack=true in the exec string.
On a specific machine, while testing jboss-remoting, I also found it necessary to adjust (increase) the timeouts. After that I ran into many java.lang.IllegalMonitorStateException at java.lang.Object.wait(J)V
(Native Method) at org.jboss.jrunit.harness.TestDriver.shutdown
which I solved marking the thread to be waited on that line as synchronized.
After both actions, both jrunit unit tests itself, as well as jboss-remoting unit tests gave much better results, with some issues pending in both cases. I will post the details later.