db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DERBY-6073) Test ordering instability in StatementPoolingTest
Date Mon, 18 Feb 2013 12:21:14 GMT

     [ https://issues.apache.org/jira/browse/DERBY-6073?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Knut Anders Hatlen updated DERBY-6073:
--------------------------------------

    Attachment: derby-6073-03-aa-fixConnector.diff

I think the problem is in the test framework. ConnectionPoolDataSourceConnector calls setMaxStatements(2)
on the data source before creating a connection. However, if that fails, it creates a new
data source on which it calls setCreateDatabase("create"), and returns a connection created
with this data source. The data source that creates the database does not have statement pooling
enabled, and the test case will therefore not use statement pooling if the wombat database
doesn't already exist before the test case is executed.

The attached patch (derby-6073-03-aa-fixConnector.diff) changes ConnectionPoolDataSourceConnector
so that it also enables statement pooling on data sources that have the createDatabase attribute
set. This makes StatementPoolingTest pass in my environment also if testPoolingEnabledByCheckingImplementationDetails()
runs as the first test case.

Running the full regression test suite on the patch to see if it causes problems for other
tests that use ConnectionPoolDataSourceConnector.
                
> Test ordering instability in StatementPoolingTest
> -------------------------------------------------
>
>                 Key: DERBY-6073
>                 URL: https://issues.apache.org/jira/browse/DERBY-6073
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.9.1.0, 10.10.0.0
>         Environment: Java 7, Java 8
>            Reporter: Rick Hillegas
>         Attachments: derby-6073-01-aa-fixTestCaseOrder.diff, derby-6073-02-aa-java8tweak.diff,
derby-6073-03-aa-fixConnector.diff, z.diff
>
>
> StatementPoolingTest.testPoolingEnabledByCheckingImplementationDetails() assumes that
the client-side statement cache will have been primed by a previous test case, testCacheOverflow().
On Java 7 and Java 8 the test order is not deterministic. If testPoolingEnabledByCheckingImplementationDetails()
is the first test case to run, then it fails with this error:
> org.apache.derbyTesting.functionTests.tests.jdbcapi.StatementPoolingTest.assertClassName(StatementPoolingTest.java:147)
> 	at org.apache.derbyTesting.functionTests.tests.jdbcapi.StatementPoolingTest.testPoolingEnabledByCheckingImplementationDetails(StatementPoolingTest.java:89)
> I will attach a patch which forces testPoolingEnabledByCheckingImplementationDetails()
to be first in the test order. With this patch, StatementPoolingTest fails for me on Java
7 when run on the 10.9 branch as well as on trunk.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message