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 my...@apache.org on 2012/09/14 00:52:58 UTC
svn commit: r1384589 - in /db/derby/code/branches/10.8: ./
java/client/org/apache/derby/client/net/
java/testing/org/apache/derbyTesting/functionTests/tests/largedata/
Author: myrnavl
Date: Thu Sep 13 22:52:57 2012
New Revision: 1384589
URL: http://svn.apache.org/viewvc?rev=1384589&view=rev
Log:
DERBY-5638; intermittent test failure in test_05_ClobNegative when running full largedata._Suite; LobLimitsTestjava.sql.SQLException: Table/View 'BLOBTBL' already exists in Schema 'APP'.
backporting revision 1298907, 1300459, 1301109, 1303630 and 1305524 from trunk.
Modified:
db/derby/code/branches/10.8/ (props changed)
db/derby/code/branches/10.8/java/client/org/apache/derby/client/net/NetCursor.java (props changed)
db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/Derby5624Test.java
db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/LobLimitsClientTest.java
db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/LobLimitsLiteTest.java
db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/LobLimitsTest.java
Propchange: db/derby/code/branches/10.8/
------------------------------------------------------------------------------
Merged /db/derby/code/trunk:r1298907,1300459,1301109,1303630,1305524
Propchange: db/derby/code/branches/10.8/java/client/org/apache/derby/client/net/NetCursor.java
------------------------------------------------------------------------------
Merged /db/derby/code/trunk/java/client/org/apache/derby/client/net/NetCursor.java:r1298907,1300459,1301109,1303630,1305524
Modified: db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/Derby5624Test.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/Derby5624Test.java?rev=1384589&r1=1384588&r2=1384589&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/Derby5624Test.java (original)
+++ db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/Derby5624Test.java Thu Sep 13 22:52:57 2012
@@ -141,8 +141,7 @@ public class Derby5624Test extends BaseJ
{
TestSuite suite = new TestSuite(name);
suite.addTestSuite(Derby5624Test.class);
- return new CleanDatabaseTestSetup(
- DatabasePropertyTestSetup.setLockTimeouts(suite, 2, 4))
+ return new CleanDatabaseTestSetup(suite)
{
/**
* Creates the tables used in the test cases.
Modified: db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/LobLimitsClientTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/LobLimitsClientTest.java?rev=1384589&r1=1384588&r2=1384589&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/LobLimitsClientTest.java (original)
+++ db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/LobLimitsClientTest.java Thu Sep 13 22:52:57 2012
@@ -37,6 +37,6 @@ public class LobLimitsClientTest extends
}
public static Test suite() {
- return TestConfiguration.clientServerDecorator(LobLimitsTest.suite());
+ return (TestConfiguration.clientServerDecorator(LobLimitsTest.suite()));
}
}
Modified: db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/LobLimitsLiteTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/LobLimitsLiteTest.java?rev=1384589&r1=1384588&r2=1384589&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/LobLimitsLiteTest.java (original)
+++ db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/LobLimitsLiteTest.java Thu Sep 13 22:52:57 2012
@@ -21,9 +21,12 @@ limitations under the License.
package org.apache.derbyTesting.functionTests.tests.largedata;
+import java.util.Properties;
+
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.apache.derbyTesting.junit.SystemPropertyTestSetup;
import org.apache.derbyTesting.junit.TestConfiguration;
Modified: db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/LobLimitsTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/LobLimitsTest.java?rev=1384589&r1=1384588&r2=1384589&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/LobLimitsTest.java (original)
+++ db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/LobLimitsTest.java Thu Sep 13 22:52:57 2012
@@ -213,11 +213,11 @@ public class LobLimitsTest extends BaseJ
selectUpdateBlob2("BlobTest #6", selectBlob2, selectBlob,
BIG_LOB_SZ, 0, 1, DATAFILE);
- deleteTable("BLOBTBL2", 1);
+ deleteAndTruncateTable("BLOBTBL2", 1);
commit();
- deleteTable("BLOBTBL", 3);
+ deleteAndTruncateTable("BLOBTBL", 3);
}
public void test_02_BlobNegative() throws SQLException {
@@ -384,7 +384,7 @@ public class LobLimitsTest extends BaseJ
// stream length is one less than actual length of the stream
assertSQLState("XSDA4", sqle);
}
- deleteTable("CLOBTBL2", 2);
+ deleteAndTruncateTable("CLOBTBL2", 2);
try {
// give -ve streamlength
@@ -397,7 +397,7 @@ public class LobLimitsTest extends BaseJ
selectClob("ClobTest #12.2", selectClob, BIG_LOB_SZ, 4, 0);
- deleteTable("CLOBTBL", 2);
+ deleteAndTruncateTable("CLOBTBL", 2);
// Negative tests use the setClob API to insert a 4GB clob
@@ -422,10 +422,26 @@ public class LobLimitsTest extends BaseJ
assertSQLState("22003", sqle);
}
}
+ rollback();
// ADD NEW TESTS HERE
}
+ //DERBY-5638
+ // Following shutdown will ensure that all the logs are applied to the
+ // database and hence there are no unapplied log files left at the end
+ // of the suite.
+ //This test deals will large data objects which can cause us to have
+ // large log files and if the database is not shutdown at the end of the
+ // suite, the suite will finish successfully but will leave a database
+ // directory with large number of big log files. Nightly machines which
+ // run this suite on a regular basis can eventually run out of disk space
+ // if those machines do not delete the database directories from multiple
+ // runs.
+ public void test_06_shutdownDB() throws Exception {
+ TestConfiguration.getCurrent().shutdownDatabase();
+ }
+
private void negativeSpaceTruncationTest(String msg)
throws Exception {
PreparedStatement insertClob2 =
@@ -824,10 +840,19 @@ public class LobLimitsTest extends BaseJ
assertEquals(file, lobstream);
}
- private void deleteTable(String table,
+ private void deleteAndTruncateTable(String table,
int expectedRows) throws SQLException {
- int count = createStatement().executeUpdate(
+ Statement s = createStatement();
+ //Keep the delete call to exercise delete of long blobs and clobs.
+ // This is a separate code path through Derby compared to truncate
+ // table code path.
+ int count = s.executeUpdate(
"DELETE FROM " + JDBC.escape(table));
+ //DERBY-5638
+ //Adding truncate call which will give back the disk space being
+ // used by the table at commit time rather than wait for test
+ // infrastructure to drop the table.
+ s.executeUpdate("TRUNCATE TABLE " + JDBC.escape(table));
commit();
verifyTest(count, expectedRows, "Rows deleted =");
}