Thread: Failing test on 8.2-506

Failing test on 8.2-506

From
Miroslav Šulc
Date:
Hi,

I just wanted to package jdbc driver 8.2-506 for gentoo linux distro but
came across this bug in the tests:

runtest:
    [junit] Testsuite: org.postgresql.test.jdbc2.Jdbc2TestSuite
    [junit] Tests run: 243, Failures: 1, Errors: 0, Time elapsed: 52.261 sec
    [junit]
    [junit] Testcase:
testTables(org.postgresql.test.jdbc2.DatabaseMetaDataTest):       FAILED
    [junit] expected:<test[metadata]> but was:<test[index]>
    [junit] junit.framework.ComparisonFailure: expected:<test[metadata]>
but was:<test[index]>
    [junit]     at
org.postgresql.test.jdbc2.DatabaseMetaDataTest.testTables(DatabaseMetaDataTest.java:78)
    [junit]
    [junit]
    [junit] Test org.postgresql.test.jdbc2.Jdbc2TestSuite FAILED
    [junit] Testsuite: org.postgresql.test.jdbc2.optional.OptionalTestSuite
    [junit] Tests run: 38, Failures: 0, Errors: 0, Time elapsed: 2.085 sec
    [junit]
    [junit] Testsuite: org.postgresql.test.jdbc3.Jdbc3TestSuite
    [junit] Tests run: 50, Failures: 0, Errors: 0, Time elapsed: 1.479 sec
    [junit]
    [junit] Testsuite: org.postgresql.test.xa.XATestSuite
    [junit] Tests run: 8, Failures: 0, Errors: 0, Time elapsed: 0.306 sec
    [junit]

--
Miroslav Šulc


Re: Failing test on 8.2-506

From
Miroslav Šulc
Date:
The result is the same for 8.1-410. With 8.0-320 I get even more errors:

runtest:
    [junit] Testsuite: org.postgresql.test.jdbc2.Jdbc2TestSuite
    [junit] Tests run: 198, Failures: 3, Errors: 5, Time elapsed: 12.199 sec
    [junit]
    [junit] Testcase:
testTables(org.postgresql.test.jdbc2.DatabaseMetaDataTest):       FAILED
    [junit] expected:<test[metadata]> but was:<test[index]>
    [junit] junit.framework.ComparisonFailure: expected:<test[metadata]>
but was:<test[index]>
    [junit]     at
org.postgresql.test.jdbc2.DatabaseMetaDataTest.testTables(DatabaseMetaDataTest.java:78)
    [junit]
    [junit]
    [junit] Testcase:
testCrossReference(org.postgresql.test.jdbc2.DatabaseMetaDataTest):
Caused an ERROR
    [junit] ERROR: function information_schema._pg_keypositions() does
not exist
    [junit] java.sql.SQLException: ERROR: function
information_schema._pg_keypositions() does not exist
    [junit]     at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1501)
    [junit]     at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1283)
    [junit]     at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:186)
    [junit]     at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:392)
    [junit]     at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:314)
    [junit]     at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:221)
    [junit]     at
org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getImportedExportedKeys(AbstractJdbc2DatabaseMetaData.java:3240)
    [junit]     at
org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getCrossReference(AbstractJdbc2DatabaseMetaData.java:3655)
    [junit]     at
org.postgresql.test.jdbc2.DatabaseMetaDataTest.testCrossReference(DatabaseMetaDataTest.java:105)
    [junit]
    [junit]
    [junit] Testcase:
testForeignKeyActions(org.postgresql.test.jdbc2.DatabaseMetaDataTest):
Caused an ERROR
    [junit] ERROR: function information_schema._pg_keypositions() does
not exist
    [junit] java.sql.SQLException: ERROR: function
information_schema._pg_keypositions() does not exist
    [junit]     at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1501)
    [junit]     at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1283)
    [junit]     at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:186)
    [junit]     at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:392)
    [junit]     at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:314)
    [junit]     at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:221)
    [junit]     at
org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getImportedExportedKeys(AbstractJdbc2DatabaseMetaData.java:3240)
    [junit]     at
org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getImportedKeys(AbstractJdbc2DatabaseMetaData.java:3536)
    [junit]     at
org.postgresql.test.jdbc2.DatabaseMetaDataTest.testForeignKeyActions(DatabaseMetaDataTest.java:156)
    [junit]
    [junit]
    [junit] Testcase:
testForeignKeysToUniqueIndexes(org.postgresql.test.jdbc2.DatabaseMetaDataTest):
Caused an ERROR
    [junit] ERROR: function information_schema._pg_keypositions() does
not exist
    [junit] java.sql.SQLException: ERROR: function
information_schema._pg_keypositions() does not exist
    [junit]     at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1501)
    [junit]     at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1283)
    [junit]     at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:186)
    [junit]     at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:392)
    [junit]     at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:314)
    [junit]     at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:221)
    [junit]     at
org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getImportedExportedKeys(AbstractJdbc2DatabaseMetaData.java:3240)
    [junit]     at
org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getImportedKeys(AbstractJdbc2DatabaseMetaData.java:3536)
    [junit]     at
org.postgresql.test.jdbc2.DatabaseMetaDataTest.testForeignKeysToUniqueIndexes(DatabaseMetaDataTest.java:183)
    [junit]
    [junit]
    [junit] Testcase:
testMultiColumnForeignKeys(org.postgresql.test.jdbc2.DatabaseMetaDataTest):
Caused an ERROR
    [junit] ERROR: function information_schema._pg_keypositions() does
not exist
    [junit] java.sql.SQLException: ERROR: function
information_schema._pg_keypositions() does not exist
    [junit]     at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1501)
    [junit]     at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1283)
    [junit]     at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:186)
    [junit]     at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:392)
    [junit]     at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:314)
    [junit]     at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:221)
    [junit]     at
org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getImportedExportedKeys(AbstractJdbc2DatabaseMetaData.java:3240)
    [junit]     at
org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getImportedKeys(AbstractJdbc2DatabaseMetaData.java:3536)
    [junit]     at
org.postgresql.test.jdbc2.DatabaseMetaDataTest.testMultiColumnForeignKeys(DatabaseMetaDataTest.java:206)
    [junit]
    [junit]
    [junit] Testcase:
testForeignKeys(org.postgresql.test.jdbc2.DatabaseMetaDataTest):  Caused
an ERROR
    [junit] ERROR: function information_schema._pg_keypositions() does
not exist
    [junit] java.sql.SQLException: ERROR: function
information_schema._pg_keypositions() does not exist
    [junit]     at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1501)
    [junit]     at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1283)
    [junit]     at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:186)
    [junit]     at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:392)
    [junit]     at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:314)
    [junit]     at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:221)
    [junit]     at
org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getImportedExportedKeys(AbstractJdbc2DatabaseMetaData.java:3240)
    [junit]     at
org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getImportedKeys(AbstractJdbc2DatabaseMetaData.java:3536)
    [junit]     at
org.postgresql.test.jdbc2.DatabaseMetaDataTest.testForeignKeys(DatabaseMetaDataTest.java:245)
    [junit]
    [junit]
    [junit] Testcase:
testValues(org.postgresql.test.jdbc2.DatabaseMetaDataPropertiesTest):
FAILED
    [junit] expected:<32> but was:<0>
    [junit] junit.framework.AssertionFailedError: expected:<32> but was:<0>
    [junit]     at
org.postgresql.test.jdbc2.DatabaseMetaDataPropertiesTest.testValues(DatabaseMetaDataPropertiesTest.java:114)
    [junit]
    [junit]
    [junit] Testcase: testSetTime(org.postgresql.test.jdbc2.TimeTest):
FAILED
    [junit] expected:<09:01:02> but was:<05:01:02>
    [junit] junit.framework.AssertionFailedError: expected:<09:01:02>
but was:<05:01:02>
    [junit]     at
org.postgresql.test.jdbc2.TimeTest.timeTest(TimeTest.java:275)
    [junit]     at
org.postgresql.test.jdbc2.TimeTest.testSetTime(TimeTest.java:201)
    [junit]
    [junit]
    [junit] Test org.postgresql.test.jdbc2.Jdbc2TestSuite FAILED
    [junit] Testsuite: org.postgresql.test.jdbc2.optional.OptionalTestSuite
    [junit] Tests run: 38, Failures: 0, Errors: 0, Time elapsed: 2.517 sec
    [junit]
    [junit] Testsuite: org.postgresql.test.jdbc3.Jdbc3TestSuite
    [junit] Tests run: 16, Failures: 0, Errors: 0, Time elapsed: 0.721 sec
    [junit]

I am running all the tests against postgresql-8.2.4. Is that the cause
why 8.0 driver fails that much?

--
Miroslav Šulc


Miroslav Šulc napsal(a):
> Hi,
>
> I just wanted to package jdbc driver 8.2-506 for gentoo linux distro
> but came across this bug in the tests:
>
> runtest:
>    [junit] Testsuite: org.postgresql.test.jdbc2.Jdbc2TestSuite
>    [junit] Tests run: 243, Failures: 1, Errors: 0, Time elapsed:
> 52.261 sec
>    [junit]
>    [junit] Testcase:
> testTables(org.postgresql.test.jdbc2.DatabaseMetaDataTest):       FAILED
>    [junit] expected:<test[metadata]> but was:<test[index]>
>    [junit] junit.framework.ComparisonFailure:
> expected:<test[metadata]> but was:<test[index]>
>    [junit]     at
> org.postgresql.test.jdbc2.DatabaseMetaDataTest.testTables(DatabaseMetaDataTest.java:78)
>
>    [junit]
>    [junit]
>    [junit] Test org.postgresql.test.jdbc2.Jdbc2TestSuite FAILED
>    [junit] Testsuite:
> org.postgresql.test.jdbc2.optional.OptionalTestSuite
>    [junit] Tests run: 38, Failures: 0, Errors: 0, Time elapsed: 2.085 sec
>    [junit]
>    [junit] Testsuite: org.postgresql.test.jdbc3.Jdbc3TestSuite
>    [junit] Tests run: 50, Failures: 0, Errors: 0, Time elapsed: 1.479 sec
>    [junit]
>    [junit] Testsuite: org.postgresql.test.xa.XATestSuite
>    [junit] Tests run: 8, Failures: 0, Errors: 0, Time elapsed: 0.306 sec
>    [junit]
>
> --
> Miroslav Šulc

Re: Failing test on 8.2-506

From
Kris Jurka
Date:

On Fri, 3 Aug 2007, Miroslav Šulc wrote:

> The result is the same for 8.1-410. With 8.0-320 I get even more errors:
>

The 8.0 failures are from running against a server version > 8.0.  The
JDBC driver is backward compatible, but not forward.

Kris Jurka

Re: Failing test on 8.2-506

From
Miroslav Šulc
Date:
Thanks, you are right, the database was not clean.

--
Miroslav Šulc



Kris Jurka napsal(a):
>
>
> On Fri, 3 Aug 2007, Miroslav Šulc wrote:
>
>> I just wanted to package jdbc driver 8.2-506 for gentoo linux distro
>> but came across this bug in the tests:
>>
>>   [junit] Testcase:
>> testTables(org.postgresql.test.jdbc2.DatabaseMetaDataTest):       FAILED
>>   [junit] expected:<test[metadata]> but was:<test[index]>
>>   [junit] junit.framework.ComparisonFailure:
>> expected:<test[metadata]> but was:<test[index]>
>>   [junit]     at
>> org.postgresql.test.jdbc2.DatabaseMetaDataTest.testTables(DatabaseMetaDataTest.java:78)
>>
>>   [junit]
>
> Are you sure you're running on a clean database?  No part of the
> driver or test suite does anything with a table called testindex.
>
> jurka@fred:~/pg/jdbc/postgresql-jdbc-8.2-506.src$ grep -r testindex *
> | wc -l
> 0
>
> Kris Jurka

--
--
Miroslav Šulc
StartNet s.r.o.
--------------------------------------------------------------
Schodová 309/10, Praha 5, 150 00, Česká republika
--------------------------------------------------------------
ICQ: 60144073
web: www.startnet.cz, www.novavystavba.cz, wordgen.startnet.cz
--------------------------------------------------------------
mobil: +420 603 711 413
--------------------------------------------------------------


Re: Failing test on 8.2-506

From
Kris Jurka
Date:

On Fri, 3 Aug 2007, Miroslav Šulc wrote:

> I just wanted to package jdbc driver 8.2-506 for gentoo linux distro but
> came across this bug in the tests:
>
>   [junit] Testcase:
> testTables(org.postgresql.test.jdbc2.DatabaseMetaDataTest):       FAILED
>   [junit] expected:<test[metadata]> but was:<test[index]>
>   [junit] junit.framework.ComparisonFailure: expected:<test[metadata]> but
> was:<test[index]>
>   [junit]     at
> org.postgresql.test.jdbc2.DatabaseMetaDataTest.testTables(DatabaseMetaDataTest.java:78)
>   [junit]

Are you sure you're running on a clean database?  No part of the driver or
test suite does anything with a table called testindex.

jurka@fred:~/pg/jdbc/postgresql-jdbc-8.2-506.src$ grep -r testindex * | wc
-l
0

Kris Jurka