You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by kr...@apache.org on 2011/03/06 23:31:15 UTC

svn commit: r1078608 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java

Author: kristwaa
Date: Sun Mar  6 22:31:15 2011
New Revision: 1078608

URL: http://svn.apache.org/viewvc?rev=1078608&view=rev
Log:
DERBY-4915: test failure in OSReadOnlyTest in assertDirectoryDeleted

Increase sleep time and number of deletion attempts.

Patch file: derby-4915-2a-increased_sleep.diff

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java?rev=1078608&r1=1078607&r2=1078608&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java Sun Mar  6 22:31:15 2011
@@ -1470,8 +1470,8 @@ public abstract class BaseJDBCTestCase
      * directory, even if one of the delete operations fails.
      * <p>
      * After having tried to delete all files once, any remaining files will be
-     * attempted deleted again after a pause. This is repeated twice, resulting
-     * in three failed delete attempts for any single file before the method
+     * attempted deleted again after a pause. This is repeated, resulting
+     * in multiple failed delete attempts for any single file before the method
      * gives up and raises a failure.
      * <p>
      * The approach above will mask any slowness involved in releasing file
@@ -1485,7 +1485,12 @@ public abstract class BaseJDBCTestCase
     public static void assertDirectoryDeleted(File dir) {
         File[] fl = null;
         int attempts = 0;
-        while (attempts < 3) {
+        while (attempts < 4) {
+            try {
+                Thread.sleep(attempts * 2000);
+            } catch (InterruptedException ie) {
+                // Ignore
+            }
             try {
                 fl = PrivilegedFileOpsForTests.persistentRecursiveDelete(dir);
                 attempts++;
@@ -1505,11 +1510,6 @@ public abstract class BaseJDBCTestCase
                     sb.append(' ').append(i).append('=').append(fl[i]);
                 }
                 System.out.println(sb);
-                try {
-                    Thread.sleep(attempts * 1000);
-                } catch (InterruptedException ie) {
-                    // Ignore
-                }
             }
         }