[jboss-svn-commits] JBL Code SVN: r29850 - in labs/jbosstm/trunk/ArjunaCore/arjuna/tests: classes/com/hp/mwtests/ts/arjuna/reaper and 1 other directory.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Oct 28 11:26:32 EDT 2009
Author: adinn
Date: 2009-10-28 11:26:31 -0400 (Wed, 28 Oct 2009)
New Revision: 29850
Modified:
labs/jbosstm/trunk/ArjunaCore/arjuna/tests/byteman-scripts/reaper.txt
labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/reaper/ReaperTestCase2.java
Log:
added extra checks to reaper test case 3 to ensure the reapables are queued in the expected order -- fixes for JBTM-624
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/tests/byteman-scripts/reaper.txt
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/tests/byteman-scripts/reaper.txt 2009-10-28 14:18:43 UTC (rev 29849)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/tests/byteman-scripts/reaper.txt 2009-10-28 15:26:31 UTC (rev 29850)
@@ -27,6 +27,21 @@
rendezvous("reaper1")
ENDRULE
+# rendezvous and set a flag to record which reaper element is about to be timed out
+# if a client enables this rendezvous then it must also check and clear the flag
+RULE track next element to be processed
+CLASS com.arjuna.ats.arjuna.coordinator.TransactionReaper
+METHOD check
+AT SYNCHRONIZE 2
+BIND NOTHING
+IF isRendezvous("reaper element", 2)
+DO debug("reaper element"),
+ flag($reaperElement._control),
+ rendezvous("reaper element"),
+ debug("reaper element"),
+ rendezvous("reaper element")
+ENDRULE
+
# rendezvous before processing a timed out reaper element
RULE pause transaction reaper 2
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/reaper/ReaperTestCase2.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/reaper/ReaperTestCase2.java 2009-10-28 14:18:43 UTC (rev 29849)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/reaper/ReaperTestCase2.java 2009-10-28 15:26:31 UTC (rev 29850)
@@ -68,6 +68,9 @@
// enable a repeatable rendezvous before checking the reapable queue
enableRendezvous("reaper1", true);
+ // enable a repeatable rendezvous when synchronizing on a timed out reapoer element so we can check that
+ // the element is the one we expect.
+ enableRendezvous("reaper element", true);
// enable a repeatable rendezvous before processing a timed out reapable
// enableRendezvous("reaper2", true);
// enable a repeatable rendezvous before scheduling a reapable in the worker queue for cancellation
@@ -128,6 +131,18 @@
triggerRendezvous("reaper1");
+ // latch the reaper at the reaper element check
+
+ triggerRendezvous("reaper element");
+
+ // check that we have dequeued reapable0
+
+ assertTrue(checkAndClearFlag(reapable0));
+
+ // unlatch the reaper so it can process the element
+
+ triggerRendezvous("reaper element");
+
// latch the reaper before it tests the queue again
triggerRendezvous("reaper1");
@@ -156,6 +171,18 @@
triggerRendezvous("reaper1");
+ // latch the reaper at the reaper element check
+
+ triggerRendezvous("reaper element");
+
+ // check that we have dequeued reapable1
+
+ assertTrue(checkAndClearFlag(reapable1));
+
+ // unlatch the reaper so it can process the element
+
+ triggerRendezvous("reaper element");
+
// latch the reaper before it tests the queue again
triggerRendezvous("reaper1");
@@ -175,6 +202,18 @@
triggerRendezvous("reaper1");
+ // latch the reaper at the reaper element check
+
+ triggerRendezvous("reaper element");
+
+ // check that we have dequeued reapable0
+
+ assertTrue(checkAndClearFlag(reapable0));
+
+ // unlatch the reaper so it can process the element
+
+ triggerRendezvous("reaper element");
+
// latch the reaper before it tests the queue again
triggerRendezvous("reaper1");
@@ -241,6 +280,18 @@
triggerRendezvous("reaper1");
+ // latch the reaper at the reaper element check
+
+ triggerRendezvous("reaper element");
+
+ // check that we have dequeued reapable2
+
+ assertTrue(checkAndClearFlag(reapable2));
+
+ // unlatch the reaper so it can process the element
+
+ triggerRendezvous("reaper element");
+
// latch the reaper before it tests the queue again
triggerRendezvous("reaper1");
@@ -252,7 +303,7 @@
assertEquals(2, reaper.numberOfTransactions());
assertEquals(2, reaper.numberOfTimeouts());
- // now let the worker dequeue a reapable and proceed to call cancel
+ // now let the worker dequeue the fourth reapable and proceed to call cancel
triggerRendezvous("reaperworker1");
@@ -265,6 +316,18 @@
triggerRendezvous("reaper1");
+ // latch the reaper at the reaper element check
+
+ triggerRendezvous("reaper element");
+
+ // check that we have dequeued reapable3
+
+ assertTrue(checkAndClearFlag(reapable3));
+
+ // unlatch the reaper so it can process the element
+
+ triggerRendezvous("reaper element");
+
// latch the reaper before it tests the queue again
triggerRendezvous("reaper1");
@@ -284,6 +347,18 @@
triggerRendezvous("reaper1");
+ // latch the reaper at the reaper element check
+
+ triggerRendezvous("reaper element");
+
+ // check that we have dequeued reapable2
+
+ assertTrue(checkAndClearFlag(reapable2));
+
+ // unlatch the reaper so it can process the element
+
+ triggerRendezvous("reaper element");
+
// latch the reaper before it tests the queue again
triggerRendezvous("reaper1");
@@ -305,6 +380,18 @@
triggerRendezvous("reaper1");
+ // latch the reaper at the reaper element check
+
+ triggerRendezvous("reaper element");
+
+ // check that we have dequeued reapable3
+
+ assertTrue(checkAndClearFlag(reapable3));
+
+ // unlatch the reaper so it can process the element
+
+ triggerRendezvous("reaper element");
+
// latch the reaper before it tests the queue again
triggerRendezvous("reaper1");
@@ -320,6 +407,18 @@
triggerRendezvous("reaper1");
+ // latch the reaper at the reaper element check
+
+ triggerRendezvous("reaper element");
+
+ // check that we have dequeued reapable2
+
+ assertTrue(checkAndClearFlag(reapable2));
+
+ // unlatch the reaper so it can process the element
+
+ triggerRendezvous("reaper element");
+
// latch the reaper before it tests the queue again
triggerRendezvous("reaper1");
More information about the jboss-svn-commits
mailing list