db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r1063900 - in /db/derby/code/branches/10.6: ./ java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockMinion.java java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockTest.java
Date Wed, 26 Jan 2011 22:26:51 GMT
Author: kmarsden
Date: Wed Jan 26 22:26:51 2011
New Revision: 1063900

URL: http://svn.apache.org/viewvc?rev=1063900&view=rev
Log:
DERBY-4985 BootLockTest can fail with ERROR XCY03: Required property 'derby.serviceProtocol'
has not been set with slow configurations

Modified:
    db/derby/code/branches/10.6/   (props changed)
    db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockMinion.java
    db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockTest.java

Propchange: db/derby/code/branches/10.6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 26 22:26:51 2011
@@ -1,2 +1,2 @@
-/db/derby/code/trunk:938547,938796,938959,939231,940462,940469,941627,942031,942286,942476,942480,942587,944152,946794,948045,948069,951346,951366,952138,952237,952581,954344,954421,954544,954748,955001,955540,955634,956075,956234,956445,956569,956659,957260,957902,958163,958257,958264,958508,958522,958555,958618,958939,959550,962716,963206,963705,964115,965647,967304,980684,986689,986834,987539,989099,990292,997325,998170,999119,1002291,1002682,1002853,1021426,1025795,1028716,1030043,1033864,1038514,1040658,1053724,1055169,1062096
+/db/derby/code/trunk:938547,938796,938959,939231,940462,940469,941627,942031,942286,942476,942480,942587,944152,946794,948045,948069,951346,951366,952138,952237,952581,954344,954421,954544,954748,955001,955540,955634,956075,956234,956445,956569,956659,957260,957902,958163,958257,958264,958508,958522,958555,958618,958939,959550,962716,963206,963705,964115,965647,967304,980684,986689,986834,987539,989099,990292,997325,998170,999119,1002291,1002682,1002853,1021426,1025795,1028716,1030043,1033864,1038514,1040658,1053724,1055169,1062096,1063809
 /db/derby/docs/trunk:954344

Modified: db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockMinion.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockMinion.java?rev=1063900&r1=1063899&r2=1063900&view=diff
==============================================================================
--- db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockMinion.java
(original)
+++ db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockMinion.java
Wed Jan 26 22:26:51 2011
@@ -24,6 +24,7 @@ package org.apache.derbyTesting.function
 import java.sql.Connection;
 import java.sql.Statement;
 import java.net.Socket;
+import java.io.File;
 import java.lang.Integer;
 
 import org.apache.derby.jdbc.EmbeddedSimpleDataSource;
@@ -53,6 +54,11 @@ public class BootLockMinion {
             stmt = con.createStatement();
 
             stmt.execute("create table t1(i int)");
+            // Once we are finished creating the database and making the
+            // connection, create the file minionComplete that BootLockTest
+            //can check in order to proceed with its work.
+            File checkFile = new File(BootLockTest.minionCompleteFileName);
+            checkFile.createNewFile();
             //infinite loop until we get killed by BootLockTest.java
             for(;;)
             {

Modified: db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockTest.java?rev=1063900&r1=1063899&r2=1063900&view=diff
==============================================================================
--- db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockTest.java
(original)
+++ db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockTest.java
Wed Jan 26 22:26:51 2011
@@ -58,6 +58,8 @@ public class BootLockTest extends BaseJD
 
     private final static String dbName = "BootLockTestDB";
     private final static String dbDir = DEFAULT_DB_DIR + File.separator + dbName;
+    public static String minionCompleteFileName = BootLockTest.dbDir + 
+        File.separator + "minionComplete";
     private final static String dbLockFile = dbDir + File.separator +
     DataFactory.DB_LOCKFILE_NAME;
     private final static String dbExLockFile = dbDir + File.separator +
@@ -181,14 +183,12 @@ public class BootLockTest extends BaseJD
         BufferedReader minionSysErr = new BufferedReader(
             new InputStreamReader(p.getErrorStream()));
         String minionErrLine= null ;
+        File checkFile = new File(minionCompleteFileName);
         do {
-            if (lockFile.exists() && servicePropertiesFile.exists()) { 
-                // if the lock file is there and service.properties,
-                // the database has booted, return. If we don't check for
-                // service.properties, we may get just an error that the
-                // directory already exists. We'll give a few seconds too
-                // for service.properties to finish writing.
-                Thread.sleep(3000);
+            if (checkFile.exists()) { 
+                //The checkFile was created by BootLockMinion when we were
+                //sure it was finished with creating the database and making 
+                //the connection. It will get cleaned up with the database.
                 return;
             }
             // otherwise sleep for a second and try again



Mime
View raw message