Version 14

    How to run the JBossJTS regression tests

     

    First of all, you need to get and build JBoss Application Server 5.0:

       export CVSROOT=:pserver:anonymous@anoncvs.forge.jboss.com:/cvsroot/jboss
       cvs co jboss-head
       cd jboss-head/build                                            
       ./build.sh
       ./build.sh -Dmodules=testsuite
    

     

    Then you can run the following tests:

    1. Stand-alone XA recoverability tests

    2. Distributed transaction tests

    3. Crash recovery tests

     

    Stand-alone XA recoverability tests

     

    To run the stand-alone XA recoverability tests:

       cd jboss-head/testsuite
       ./build.sh -Dtest=org.jboss.test.recover.test.RecoverabilityTestCase one-test
    

     

    Non-stand-alone tests

     

    All the remaining tests are non-stand-alone tests that bring four JBoss server instances up, in order to test transactions distributed across multiple servers. Those tests must be run on a machine with four IP addresses.

     

    To run the non-stand-alone tests, you need to edit the file testsuite/local.properties so that the properties , , , and  specify the four IP addresses of your machine. If you have access to the JBoss QA Lab and want to run the tests on some of its Linux boxes, then all you need is to uncomment the following definitions:

    node0=${env.MYTESTIP_1}
    node1=${env.MYTESTIP_2}
    

    (The Linux boxes of the JBoss QA Lab give each user four IP addresses specified by the environment variables MYTESTIP_1, ..., MYTESTIP_4.)

     

    Distributed transaction tests

     

    At this point you are ready to run the distributed transaction tests that do not test crash recovery:

       cd jboss-head/testsuite
       ./build.sh dtm-tests
    

    The two DTM tests that need a XA resource manager are commented out in testsuite/build.xml because they use the Derby database engine, which is not included in JBoss. To run also those tests, you must put derby.jar in the lib directory in the default JBoss config (server/default/lib) and uncomment the following include elements in testsuite/build.xml:

       <include name="**/T09DTMXAUnitTestCase.class"></include>
       <include name="**/T10OTSXAUnitTestCase.class"></include>
    

     

    Crash recovery tests

     

    To run the crash recovery tests, edit the file conf/jboss-service.xml in the default JBoss config and uncomment the three transaction recovery MBeans: , , and . Also change the  MBean and uncomment the  element that specifies a dependency upon the  MBean. Some of the tests require a special failure-injecting logger, so you will also need change the element

       <mbean code="org.jboss.tm.recovery.BatchRecoveryLoggerService"
              name="jboss:service=RecoveryLogger">
    

    to

       <mbean code="org.jboss.test.recover.bean.MockLoggerService" 
              name="jboss:service=RecoveryLogger">
    

     

    Moreover, there are tests that require the  and  attributes of the  MBean to be respectively set to 5 seconds and 1 second, so you will need to change the elements

          <attribute name="XARetryTimeout">60</attribute>
          <attribute name="PreparedTimeout">60</attribute>
    

    to

          <attribute name="XARetryTimeout">5</attribute>
          <attribute name="PreparedTimeout">1</attribute>
    

     

    At this point you are ready to run the crash recovery tests:

       cd jboss-head/testsuite
       ./build.sh xa-recovery-tests
       ./build.sh dtm-recovery-tests
       ./build.sh ots-recovery-tests
       ./build.sh mixed-dtm-ots-recovery-tests
       ./build.sh mixed-ots-dtm-recovery-tests
    

    Alternatively, you can run all the tests above with

       cd jboss-head/testsuite
       ./build.sh all-xa-dtm-ots-recovery-tests
    

    The crash recovery tests use four JBoss server instances named "root-coordinator", "subordinate-coordinator-1", "subordinate-coordinator-2, and "xa-resource-manager". Each test consists of a pair of testcases, with names like  and . A  testcase forces a crash of some of the three coordinator servers at some specific point of a transaction run. The corresponding  testcase restarts the crashed server and checks if the recovery procedure brought the system to the expected state.

     

    Running a single crash recovery test

     

    To run a single crash recovery test, you need to manually start four JBoss server instances. Run each command below in its own window:

    cd $JBOSS_HOME/bin; ./run.sh -c xa-resource-manager -b your_node1
    cd $JBOSS_HOME/bin; ./run.sh -c subordinate-coordinator-1 -b your_node2
    cd $JBOSS_HOME/bin; ./run.sh -c subordinate-coordinator-2 -b your_node3
    cd $JBOSS_HOME/bin; ./run.sh -c root-coordinator -b your_node0
    

    You can now run a single test (e.g., ), starting with the part of the test that crashes a server (a  testcase):

    cd jboss-head/testsuite
    ./build.sh -Dtest=org.jboss.test.recover.test.CrashAfterDistributedTxCommittedIIOPTestCase one-iiop-test
    

    One of the JBoss server instances will crash. (This particular testcase crashes the root-coordinator instance.) After restarting the crashed server, run the corresponding  testcase:

    ./build.sh \
        -Dtest=org.jboss.test.recover.test.RecoveryFromCrashAfterDistributedTxCommittedIIOPTestCase \ 
        one-iiop-test
    

     

    5.x

     

     

    1. svn co https://svn.jboss.org/repos/jbossas/trunk
    2. cd trunk
    3. ./build.sh install -Dskip-download-sources -U -B
    4. cd testsuite
    5. # modify the file src/resources/crashrecovery/resources/postgres83-xa-ds.xml to point to your DB
    6. ./build.sh
    7. ./build.sh tests-ts-crash-recovery -Dcrash.db=psql_8.3 -Dcrash.tstype=jta -Dcrash.target=crash-tests-single-db-tstype
    -Dcrash.max.time=420000
    8. ./build.sh tests-ts-crash-recovery -Dcrash.db=psql_8.3 -Dcrash.tstype=jts -Dcrash.target=crash-tests-single-db-tstype
    -Dcrash.max.time=420000
    

     

    6.x

     

     

    1. svn co https://svn.jboss.org/repos/jbossas/trunk
    2. cd trunk
    3. ./build.sh install -Dskip-download-sources -U -B
    4. cd testsuite
    5. # modify the file src/resources/jbossts/resources/postgres83-xa-ds.xml to point to your DB
    6. ./build.sh
    7. ./build.sh tests-ts-crash-recovery -Djbossts.db=psql_8.3 -Djbossts.tstype=jta -Djbossts.target=crash-tests-single-db-tstype
    -Djbossts.max.time=420000
    8. ./build.sh tests-ts-crash-recovery -Djbossts.db=psql_8.3
    -Djbossts.tstype=jts -Djbossts.target=crash-tests-single-db-tstype
    -Djbossts.max.time=420000

     

    Related