[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/statetransfer ...

Vladmir Blagojevic vladimir.blagojevic at jboss.com
Sun Jul 22 20:34:52 EDT 2007


  User: vblagojevic
  Date: 07/07/22 20:34:52

  Modified:    tests/functional/org/jboss/cache/statetransfer 
                        StateTransferConcurrencyTest.java
  Log:
  [JBCACHE-983] - State transfer test failures ( to do with concurrent eviction and activation )
  
  Revision  Changes    Path
  1.2       +17 -20    JBossCache/tests/functional/org/jboss/cache/statetransfer/StateTransferConcurrencyTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: StateTransferConcurrencyTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/statetransfer/StateTransferConcurrencyTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- StateTransferConcurrencyTest.java	21 Jul 2007 17:00:42 -0000	1.1
  +++ StateTransferConcurrencyTest.java	23 Jul 2007 00:34:52 -0000	1.2
  @@ -32,7 +32,7 @@
    * TODO add tests with classloader regions
    *
    * @author <a href="mailto://brian.stansberry@jboss.com">Brian Stansberry</a>
  - * @version $Id: StateTransferConcurrencyTest.java,v 1.1 2007/07/21 17:00:42 vblagojevic Exp $
  + * @version $Id: StateTransferConcurrencyTest.java,v 1.2 2007/07/23 00:34:52 vblagojevic Exp $
    */
   public class StateTransferConcurrencyTest extends StateTransferTestBase
   {
  @@ -90,10 +90,7 @@
         {
            // Create a semaphore and take all its tickets
            Semaphore semaphore = new Semaphore(count);
  -         for (int i = 0; i < count; i++)
  -         {
  -            semaphore.acquire();
  -         }
  +         semaphore.acquire(count);
   
            // Create activation threads that will block on the semaphore
            CacheSPI[] caches = new CacheSPI[count];
  @@ -195,10 +192,7 @@
         {
            // Create a semaphore and take all its tickets
            Semaphore semaphore = new Semaphore(count);
  -         for (int i = 0; i < count; i++)
  -         {
  -            semaphore.acquire();
  -         }
  +         semaphore.acquire(count);
   
            // Create activation threads that will block on the semaphore
            CacheSPI[] caches = new CacheSPI[count];
  @@ -360,10 +354,7 @@
   
            // Create a semaphore and take all its tickets
            Semaphore semaphore = new Semaphore(count);
  -         for (int i = 0; i < count; i++)
  -         {
  -            semaphore.acquire();
  -         }
  +         semaphore.acquire(count);
   
            // Create stressor threads that will block on the semaphore
   
  @@ -398,17 +389,23 @@
   
               // Sleep to ensure the threads get all the semaphore tickets
               // and to ensure puts are actively in progress
  -            TestingUtil.sleepThread((long) 300);
  +            TestingUtil.sleepThread((long) 1000);
  +            
  +            //Stop the stressor so we don't pollute cacheA's state
  +            // with too many messages sent after activation -- we want
  +            // to compare transferred state with the sender
  +            
  +            for(CacheStressor stressor:stressors){
  +            	stressor.stopPuts();	
  +			}      
  +            
  +            TestingUtil.sleepThread((long) 1000);
   
               // Activate cacheA
               for (int i = 0; i < count; i++)
               {
  -               //              System.out.println("Activating /" + names[i] + " on A");
  +               System.out.println("Activating /" + names[i] + " on A");             
                  cacheA.getRegion(Fqn.fromString("/" + names[i]), true).activate();
  -               // Stop the stressor so we don't pollute cacheA's state
  -               // with too many messages sent after activation -- we want
  -               // to compare transferred state with the sender
  -               stressors[i].stopPuts();
                  System.out.println("Run " + x + "-- /" + names[i] + " activated on A");
                  // Reacquire one semaphore ticket
                  boolean acquired = semaphore.tryAcquire(60, TimeUnit.SECONDS);
  
  
  



More information about the jboss-cvs-commits mailing list