db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r419479 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/services/T_DaemonService.java
Date Thu, 06 Jul 2006 08:04:01 GMT
Author: kahatlen
Date: Thu Jul  6 01:04:01 2006
New Revision: 419479

URL: http://svn.apache.org/viewvc?rev=419479&view=rev
Log:
DERBY-989: unit/daemonService.unit fails intermittently: 'ran out of time'

Two test fixes (in T_DaemonService.java)

  1) Clear the list of clients before each iteration of the test. This
     makes the failure be exposed earlier (10 minutes instead of one
     hour) because t_checkStatus() doesn't have to wait for
     unsubscribed clients to be serviced.

  2) Make the test accept that a client is serviced once after it has
     unsubscribed. This could happen if the client is being serviced
     when unsubscribe() is called.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/services/T_DaemonService.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/services/T_DaemonService.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/services/T_DaemonService.java?rev=419479&r1=419478&r2=419479&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/services/T_DaemonService.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/services/T_DaemonService.java
Thu Jul  6 01:04:01 2006
@@ -110,6 +110,11 @@
 	*/
 	protected void runTestSet() throws T_Fail
 	{
+		// we don't want t_checkStatus() to hang because of
+		// unsubscribed records from a previous, failed iteration
+		// (DERBY-989)
+		serviceRecord.clear();
+
 		try
 		{
 			/* test basic DaemonService interface */
@@ -243,8 +248,16 @@
 
 		synchronized(s1)
 		{
-			if (save != s1.timesServiced)
-				throw T_Fail.testFailMsg("unsubscribed continue to get serviced");
+			// DERBY-989: The client should not be serviced after it
+			// unsubscribes. However, it might have been in the
+			// process of being serviced when unsubscribe() was
+			// called. Therefore, performWork() can run even after the
+			// save variable was initialized, but only once.
+			int diff = s1.timesServiced - save;
+			// Check that the client has not been serviced more than
+			// once after it unsubscribed.
+			T_Fail.T_ASSERT((diff == 0 || diff == 1),
+							"unsubscribed continue to get serviced");
 
 			// unsubscribed can subscribe again
 			s1.timesServiced = 0;



Mime
View raw message