[jboss-jira] [JBoss JIRA] (JGRP-1740) Byteman tests fail on Windows

Richard Achmatowicz (JIRA) jira-events at lists.jboss.org
Sun Nov 24 19:22:06 EST 2013


    [ https://issues.jboss.org/browse/JGRP-1740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12926389#comment-12926389 ] 

Richard Achmatowicz commented on JGRP-1740:
-------------------------------------------

I had a further look at this. Byteman has a problem loading the agent dynamically on Windows 7 / Sun JDK, relating to a problem with the JVM not furnishing correct information about all JVMs running locally. So instead of loading the agent dynamically, via the @BMScript annotation, I thought a safer approach would be to load the agent when starting the test.

By adding these two flags to the set of JVM args passed to the byteman instance of runtest:
{noformat}
   <jvmarg value="-javaagent:${lib.dir}/byteman.jar=listener:true"/>
   <jvmarg value="-Dorg.jboss.byteman.contrib.bmunit.agent.inhibit=true"/>
{noformat}
we load the agent ourselves statically, and we tell @BMUnit not to try to load the agent dynamically. This solves the "find and install the agent" problem and works both on Linux and Windows.

To avoid having to create a separate runtest-byteman macro (we don't want the agent to be installed on the other tests), I also modified the runtest macro to allow passing in additional nested arguuments (jvmarg, sysproperty, fileset, ...) to the testng ant task. This allows modifying only the byteman runtest invovation to look like this:

{noformat}
    <target name="byteman" depends="postcompile">
        <mkdir dir="${tmp.dir}/test-results/xml/byteman"/>
        <runtest classpath="jg.classpath.byteman"
                 testname.ext="byteman"
                 threadcount="1"
                 parallel="false"
                 testng.xmlfile="byteman.xml">
            <additional-args>
                <jvmarg value="-Dorg.jboss.byteman.contrib.bmunit.agent.inhibit=true"/>
                <jvmarg value="-javaagent:${lib.dir}/byteman.jar=listener:true"/>
            </additional-args>
        </runtest>
    </target>
{noformat}

 

                
> Byteman tests fail on Windows
> -----------------------------
>
>                 Key: JGRP-1740
>                 URL: https://issues.jboss.org/browse/JGRP-1740
>             Project: JGroups
>          Issue Type: Bug
>    Affects Versions: 3.5
>         Environment: Windows
>            Reporter: Richard Achmatowicz
>            Assignee: Bela Ban
>            Priority: Minor
>             Fix For: 3.5
>
>
> The Byteman tests in the Jgroups testsuite fail when running the testsuite on Windows. The error text is as follows:
> {noformat}
> byteman:
>    [testng] -- onStart -- byteman
>    [testng] failed config: java.io.FileNotFoundException: Rule file not found for Byteman test case org.jgroups.tests.byteman.BecomeServerTest#testSendingOfMsgsOnUnconnectedChannel
>    [testng] FAIL: [1] org.jgroups.tests.byteman.BecomeServerTest.bmngBeforeTest-Method()
>    [testng] SKIP: [1] org.jgroups.tests.byteman.BecomeServerTest.testSendingOfMsgsOnUnconnectedChannel()
>    [testng] failed config: java.io.FileNotFoundException: Rule file not found for Byteman test case org.jgroups.tests.byteman.BecomeServerTest#testSendingOfMsgsOnUnconnectedChannel
>    [testng] FAIL: [1] org.jgroups.tests.byteman.BecomeServerTest.bmngAfterTest-Method()
>    [testng] SKIP: [1] org.jgroups.tests.byteman.ForwardToCoordFailoverTest.testSendingDuringViewChange()
>    [testng] failed config: java.io.FileNotFoundException: Rule file not found for Byteman test case org.jgroups.tests.byteman.ForwardToCoordFailoverTest#testSendingDuringViewChange
>    [testng] FAIL: [1] org.jgroups.tests.byteman.ForwardToCoordFailoverTest.bmngAfterTest-Method()
>    [testng] SKIP: [1] org.jgroups.tests.byteman.MessageBeforeConnectedTest.testSendingOfMsgsOnUnconnectedChannel()
>    [testng] failed config: java.io.FileNotFoundException: Rule file not found for Byteman test case org.jgroups.tests.byteman.MessageBeforeConnectedTest#testSendingOfMsgsOnUnconnectedChannel
>    [testng] FAIL: [1] org.jgroups.tests.byteman.MessageBeforeConnectedTest.bmngAfterTest-Method()
>    [testng] SKIP: [1] org.jgroups.tests.byteman.SequencerFailoverTest.testBroadcastSequenceSenderIsB()
>    [testng] SKIP: [1] org.jgroups.tests.byteman.SequencerFailoverTest.testBroadcastSequenceSenderIsC()
>    [testng] SKIP: [1] org.jgroups.tests.byteman.SequencerFailoverTest.testFailoverWithMultipleThreadsSendingMessages()
>    [testng] SKIP: [1] org.jgroups.tests.byteman.SequencerFailoverTest.testResendingVersusNewMessages()
>    [testng] failed config: java.io.FileNotFoundException: Rule file not found for Byteman test case org.jgroups.tests.byteman.SequencerFailoverTest#testResendingVersusNewMessages
>    [testng] FAIL: [1] org.jgroups.tests.byteman.SequencerFailoverTest.bmngAfterTest-Method()
>    [testng] The tests failed.
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list