db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r425719 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ShutDownDBWhenNSShutsDownTest.java
Date Wed, 26 Jul 2006 12:19:43 GMT
Author: kahatlen
Date: Wed Jul 26 05:19:42 2006
New Revision: 425719

URL: http://svn.apache.org/viewvc?rev=425719&view=rev
Log:
DERBY-1563: derbynet/ShutDownDBWhenNSShutsDownTest.junit fails on
Solaris sparc

The attached patch (derby-1563.diff) fixes the problem by waiting
before checking if the file exists.

Patch contributed by Fernanda Pizzorno.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ShutDownDBWhenNSShutsDownTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ShutDownDBWhenNSShutsDownTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ShutDownDBWhenNSShutsDownTest.java?rev=425719&r1=425718&r2=425719&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ShutDownDBWhenNSShutsDownTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ShutDownDBWhenNSShutsDownTest.java
Wed Jul 26 05:19:42 2006
@@ -109,9 +109,16 @@
         String fileName = getSystemProperty("derby.system.home") +
                 java.io.File.separator + "wombat" +
                 java.io.File.separator + "db.lck";
-        assertEquals("Database is shut down",
-                dbShutDown,
-                !fileExists(fileName));
+
+        boolean fileNotFound = false;
+        int i = 0;
+        do {
+            Thread.sleep(500);
+            fileNotFound = !fileExists(fileName);
+            i ++;
+        } while (fileNotFound != dbShutDown && i < 120);
+
+        assertEquals("Database is shut down", dbShutDown, fileNotFound);
     }
 
     private boolean fileExists (final String fileName) throws Exception {



Mime
View raw message