Index: testsuite/src/main/org/jboss/test/timer/test/TimerCleanUpUnitTestCase.java
===================================================================
--- testsuite/src/main/org/jboss/test/timer/test/TimerCleanUpUnitTestCase.java	(revision 113464)
+++ testsuite/src/main/org/jboss/test/timer/test/TimerCleanUpUnitTestCase.java	(working copy)
@@ -60,23 +60,26 @@
       String jndi = "ejb/test/timer/TimerEntityExtStd";
       TimerEntityExtHome home = (TimerEntityExtHome) getEJBHome(jndi);
       TimerEntityExt entity = home.create(new Integer(333));
-      entity.startTimer(SHORT_PERIOD);
-      Thread.sleep(12 * SHORT_PERIOD);
-      assertTrue("Timer service should be associated with bean." , entity.hasTimerService(jndi));
-      entity.stopTimer();
-      int lCount = entity.getTimeoutCount();
-      assertTrue("Timeout was expected to be called at least 10 times but was "
-         + "only called: " + lCount + " times",
-         lCount >= 10);
-      Thread.sleep(5 * SHORT_PERIOD);
-      int lCount2 = entity.getTimeoutCount();
-      assertTrue("After the timer was stopped no timeout should happen but "
-         + "it was called " + (lCount2 - lCount) + " more times",
-         lCount == lCount2);
-      Thread.sleep(40 * SHORT_PERIOD);
-      assertFalse("Timer service should have been passivated and timer service association removed." 
-            , entity.hasTimerService(jndi));
-      entity.remove();
+      try{
+          entity.startTimer(SHORT_PERIOD);
+          Thread.sleep(12 * SHORT_PERIOD);
+          assertTrue("Timer service should be associated with bean." , entity.hasTimerService(jndi));
+          entity.stopTimer();
+          int lCount = entity.getTimeoutCount();
+          assertTrue("Timeout was expected to be called at least 10 times but was "
+             + "only called: " + lCount + " times",
+             lCount >= 10);
+          Thread.sleep(5 * SHORT_PERIOD);
+          int lCount2 = entity.getTimeoutCount();
+          assertTrue("After the timer was stopped no timeout should happen but "
+             + "it was called " + (lCount2 - lCount) + " more times",
+             lCount == lCount2);
+          Thread.sleep(40 * SHORT_PERIOD);
+          assertFalse("Timer service should have been passivated and timer service association removed." 
+                , entity.hasTimerService(jndi));
+       }finally{
+           entity.remove();
+       }
    }
    
    public void testEntityBeanSingleTimerHasTimerServiceAfterExpirationStd() throws Exception
@@ -84,16 +87,19 @@
       String jndi = "ejb/test/timer/TimerEntityExtStd";
       TimerEntityExtHome home = (TimerEntityExtHome) getEJBHome(jndi);
       TimerEntityExt entity = home.create(new Integer(444));
-      entity.startSingleTimer(SHORT_PERIOD);
-      Thread.sleep(5 * SHORT_PERIOD);
-      int lCount = entity.getTimeoutCount();
-      assertTrue("Timeout was expected to be called only once but was called: "
-         + lCount + " times",
-         lCount == 1);
-      Thread.sleep(40 * SHORT_PERIOD);
-      assertFalse("Timer service should have been passivated and timer service association removed."
-            , entity.hasTimerService(jndi));
-      entity.remove();
+      try{
+          entity.startSingleTimer(SHORT_PERIOD);
+          Thread.sleep(5 * SHORT_PERIOD);
+          int lCount = entity.getTimeoutCount();
+          assertTrue("Timeout was expected to be called only once but was called: "
+             + lCount + " times",
+             lCount == 1);
+          Thread.sleep(40 * SHORT_PERIOD);
+          assertFalse("Timer service should have been passivated and timer service association removed."
+                , entity.hasTimerService(jndi));
+       }finally{
+           entity.remove();
+       }
    }
 
    public void testEntityBeanTimerHasTimerServiceAfterCancellationInstPerTx() throws Exception
@@ -101,22 +107,25 @@
       String jndi = "ejb/test/timer/TimerEntityExtInstPerTx";
       TimerEntityExtHome home = (TimerEntityExtHome) getEJBHome(jndi);
       TimerEntityExt entity = home.create(new Integer(555));
-      entity.startTimer(SHORT_PERIOD);
-      Thread.sleep(12 * SHORT_PERIOD);
-      assertTrue("Timer service should be associated with bean." , entity.hasTimerService(jndi));
-      entity.stopTimer();
-      int lCount = entity.getTimeoutCount();
-      assertTrue("Timeout was expected to be called at least 10 times but was "
-         + "only called: " + lCount + " times",
-         lCount >= 10);
-      Thread.sleep(5 * SHORT_PERIOD);
-      int lCount2 = entity.getTimeoutCount();
-      assertTrue("After the timer was stopped no timeout should happen but "
-         + "it was called " + (lCount2 - lCount) + " more times",
-         lCount == lCount2);
-      assertFalse("Timer service should have been passivated and timer service association removed." 
-            , entity.hasTimerService(jndi));
-      entity.remove();
+      try{
+          entity.startTimer(SHORT_PERIOD);
+          Thread.sleep(12 * SHORT_PERIOD);
+          assertTrue("Timer service should be associated with bean." , entity.hasTimerService(jndi));
+          entity.stopTimer();
+          int lCount = entity.getTimeoutCount();
+          assertTrue("Timeout was expected to be called at least 10 times but was "
+             + "only called: " + lCount + " times",
+             lCount >= 10);
+          Thread.sleep(5 * SHORT_PERIOD);
+          int lCount2 = entity.getTimeoutCount();
+          assertTrue("After the timer was stopped no timeout should happen but "
+             + "it was called " + (lCount2 - lCount) + " more times",
+             lCount == lCount2);
+          assertFalse("Timer service should have been passivated and timer service association removed." 
+                , entity.hasTimerService(jndi));
+      }finally{
+          entity.remove();
+      }
    }
    
    public void testEntityBeanSingleTimerHasTimerServiceAfterExpirationInstPerTx() throws Exception
@@ -124,16 +133,19 @@
       String jndi = "ejb/test/timer/TimerEntityExtInstPerTx";
       TimerEntityExtHome home = (TimerEntityExtHome) getEJBHome(jndi);
       TimerEntityExt entity = home.create(new Integer(666));
-      entity.startSingleTimer(SHORT_PERIOD);
-      Thread.sleep(5 * SHORT_PERIOD);
-      assertFalse("Timer service should be associated with bean." , entity.hasTimerService(jndi));
-      int lCount = entity.getTimeoutCount();
-      assertTrue("Timeout was expected to be called only once but was called: "
-         + lCount + " times",
-         lCount == 1);
-      assertFalse("Timer service should have been passivated and timer service association removed." 
-            , entity.hasTimerService(jndi));
-      entity.remove();
+      try{
+          entity.startSingleTimer(SHORT_PERIOD);
+          Thread.sleep(5 * SHORT_PERIOD);
+          assertFalse("Timer service should be associated with bean." , entity.hasTimerService(jndi));
+          int lCount = entity.getTimeoutCount();
+          assertTrue("Timeout was expected to be called only once but was called: "
+             + lCount + " times",
+             lCount == 1);
+          assertFalse("Timer service should have been passivated and timer service association removed." 
+                , entity.hasTimerService(jndi));
+      }finally{
+          entity.remove();
+      }
    }   
    
    private EJBHome getEJBHome(String pJNDIName) throws NamingException
Index: testsuite/src/main/org/jboss/test/timer/ejb/TimerEntityBean.java
===================================================================
--- testsuite/src/main/org/jboss/test/timer/ejb/TimerEntityBean.java	(revision 113464)
+++ testsuite/src/main/org/jboss/test/timer/ejb/TimerEntityBean.java	(working copy)
@@ -58,8 +58,14 @@
    // -------------------------------------------------------------------------
 
    private EntityContext mContext;
-   private Timer sTimer;
-   private int sCounter;
+   //This is wrong on sooo many levels, however switch to CMP and accessing timer from TimerService 
+   //requires changes to more than one test...
+   //Fields are defined static. This is because persistance0type is set to "Bean" and there is no persist code.
+   //Since container has a pool of ejb intances to handle calls, there is no way to be sure that one
+   //instance is used to serve teest, hence random failures if container use different instances to handle
+   //calls(yeah, the tests are faulty)
+   private static Timer sTimer;
+   private static int sCounter;
 
    private Logger mLog = Logger.getLogger(this.getClass().getName());
 
@@ -274,6 +280,9 @@
    public void ejbRemove()
    {
       mLog.info("ejbRemove");
+      //cleanup
+      sCounter = 0;
+      sTimer= null;
    }
 
    public void ejbStore()
