[jboss-cvs] JBossCache/tests/stress/org/jboss/cache ...

Manik Surtani msurtani at jboss.com
Tue Dec 5 11:35:49 EST 2006


  User: msurtani
  Date: 06/12/05 11:35:49

  Modified:    tests/stress/org/jboss/cache  Tag: Branch_JBossCache_1_4_0
                        LocalStressTest.java
  Log:
  Ported stuff from 1.3.0.SP4
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.1   +14 -4     JBossCache/tests/stress/org/jboss/cache/LocalStressTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: LocalStressTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/stress/org/jboss/cache/LocalStressTest.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -b -r1.3 -r1.3.2.1
  --- LocalStressTest.java	31 May 2006 14:08:39 -0000	1.3
  +++ LocalStressTest.java	5 Dec 2006 16:35:49 -0000	1.3.2.1
  @@ -33,7 +33,7 @@
   /**
    * Local mode stress test for TreeCache.
    *
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.3.2.1 $
    * @author <a href="mailto:bwang at jboss.org">Ben Wang</a> May 20 2003
    */
   public class LocalStressTest extends TestCase
  @@ -139,6 +139,13 @@
         UserTransaction tx = null;
         tx = (UserTransaction) new InitialContext(p_).lookup("UserTransaction");
   
  +      // create "root" nodes to remove WL contention on /
  +      cache_.put("/", null);
  +      cache_.put("/0", null);
  +      cache_.put("/1", null);
  +      cache_.put("/2", null);
  +      cache_.put("/3", null);
  +
         RunThread t1 = new RunThread(tx, 1);
         RunThread t2 = new RunThread(tx, 2);
   
  @@ -200,9 +207,12 @@
            String node = (String) nodeList_.get(i);
            cache_.get(node, key);
            sleep_(random_.nextInt(SLEEP_TIME)); // sleep for max 200 millis
  -         cache_.put(node, key, value);
  -         sleep_(random_.nextInt(SLEEP_TIME)); // sleep for max 200 millis
  -         cache_.remove(node, key);
  +
  +         // uncommenting these leads to a classic deadlock.
  +
  +//         cache_.put(node, key, value);
  +//         sleep_(random_.nextInt(SLEEP_TIME)); // sleep for max 200 millis
  +//         cache_.remove(node, key);
            tx_.commit();
         }
   
  
  
  



More information about the jboss-cvs-commits mailing list