[ 
https://issues.apache.org/jira/browse/DERBY-3323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12561263#action_12561263
 ] 

Knut Anders Hatlen commented on DERBY-3323:
-------------------------------------------

I don't think we can rely on System.gc() actually freeing and finalizing all 
unreferenced objects. Its javadoc says that calling the method "suggests that 
the Java Virtual Machine expend effort toward recycling unused objects" and 
that it will make a "best effort to reclaim space". Calling it in 
verifyNoOpenResultSets() as a last attempt before failing is OK, I think, since 
it increases the likelihood of being able to perform the operation 
successfully. On the other hand, if a test depends on the side-effects from 
System.gc() in order to pass, I think it will be inherently unstable (as seen 
in DERBY-1585).

It's not a bug that DROP TABLE fails, in my opinion, since JDBC only guarantees 
that a ResultSet releases its resources when it has been closed, and the test 
code resembles a user error, as it does not close the ResultSets and holds 
resources for an unnecessarily long period. I'd suggest that the cleanup code 
instead closes the connection (which ensures that all its database and JDBC 
resources are released, according to its javadoc), and performs DROP TABLE in a 
different connection.

> ComparisonFailure in derbyStress
> --------------------------------
>
>                 Key: DERBY-3323
>                 URL: https://issues.apache.org/jira/browse/DERBY-3323
>             Project: Derby
>          Issue Type: Bug
>          Components: Regression Test Failure
>    Affects Versions: 10.4.0.0
>         Environment: jvm1.4 lin
> jvm1.5 lin, linN+1
> vm1.6 sles,sol, solN+1
> jvm1.5 w2003
>            Reporter: Ole Solberg
>            Assignee: Kathey Marsden
>            Priority: Minor
>
> See 
> jvm1.4 lin : 
> http://dbtg.thresher.com/derby/test/Daily/jvm1.4/FailReports/612516_bySig.html
> jvm1.5 lin, jvm1.5 linN+1 : 
> http://dbtg.thresher.com/derby/test/Daily/jvm1.5/FailReports/612516_bySig.html
> jvm1.6 sles, jvm1.6 sol, jvm1.6 solN+1: 
> http://dbtg.thresher.com/derby/test/Daily/jvm1.6/FailReports/612516_bySig.html
> jvm1.5 w2003: 
> http://dbtg.thresher.com/derby/test/10.3Branch/jvm1.5/FailReports/612526_bySig.html
> 1) 
> derbyStress(org.apache.derbyTesting.functionTests.tests.jdbcapi.JDBCHarnessJavaTest)junit.framework.ComparisonFailure:
>  Output at line 6 expected:<[Test derbyStress finished.]> but was:<[FAIL -- 
> unexpected exception ****************]>
>       at 
> org.apache.derbyTesting.functionTests.util.CanonTestCase.compareCanon(CanonTestCase.java:100)
>       at 
> org.apache.derbyTesting.functionTests.util.HarnessJavaTest.runTest(HarnessJavaTest.java:91)
>       at 
> org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:96)
>       at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
>       at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
>       at junit.extensions.TestSetup.run(TestSetup.java:25)
>       at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
>       at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
>       at junit.extensions.TestSetup.run(TestSetup.java:25)
>       at 
> org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
>       at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
>       at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
>       at junit.extensions.TestSetup.run(TestSetup.java:25)
>       at 
> org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to