-
1. Re: Debugging byteman tests
adinn Jan 15, 2016 5:07 AM (in response to jameslivingston)Hi James,
I agree that we ought to enable verbose trace for Byteman tests. Unfortunately we are stuck with maven's inability to provide an execution schema. So, in order to achieve this I think we need to globally substitute the command args for each test execution to insert the relevant property setting (-Dorg.jboss.byteman.verbose -- there is no need to specify a value).
Adding a stack trace at a finer trace level also sounds like a very good idea
Regarding the LIST functionality:
First, I'll note that tests run with BMUnit have to start up the listener. That's what BMUnit uses to upload and unload rules -- or rather what the Submit class employed by BMUnit uses. That's a deliberate choice to simplify securingthe agent. If you leave aside apps which provide trheir own uplaod manager (via the javaagent manager: option) then the only way to get rules into the Byteman agent is either via the javaagent script option or via the TransformListener's socket. There is no JVM-internal backdoor providing access to the TransformListener instance.
That said, I think this is a great idea. If we want to dump a rule listing for failing tests then we need to do that at the point where the rules are about to be unloaded. I will have to check that the class requesting the unload actually knows whether or not the test succeeded. If so then it can use the Submit class to request the listing (although we will need to wrap that request up inside an API method of class BMUnit since only it knows the agent host and port).
I'll raise a JIRA for this functionality.
-
-
3. Re: Debugging byteman tests
jameslivingston Jan 17, 2016 10:54 PM (in response to adinn)If we didn't want the socket opened for normal tests, we could write an alternative manager for the tests instead of TransformListener, which stored the Retransformer in a static variable and provided a static method which called Retransformer.listScripts() which could be used by the JUnit tests. Using the existing code would probably be easier though.
-
4. Re: Debugging byteman tests
adinn Jan 18, 2016 4:08 AM (in response to jameslivingston)James Livingston wrote:
If we didn't want the socket opened for normal tests, we could write an alternative manager for the tests instead of TransformListener, which stored the Retransformer in a static variable and provided a static method which called Retransformer.listScripts() which could be used by the JUnit tests. Using the existing code would probably be easier though.
Hmm, bypassing the socket upload in BMUnit is an interesting idea. If the BMUnit implementation were to provide the manager class then class BMUnit could actually have direct, private (i.e. secure) access to the transformer instance. Still, the socket stuff is already there, works reliably enough and does not pose any major problems in a dev environment -- so this is a low priority.