Re: Having issues with tests - Mailing list pgsql-jdbc

From Alexis Meneses
Subject Re: Having issues with tests
Date
Msg-id CANPkoZRCgqyxy3=ynU88nXCo-VjVPcH7GcoCgpiJ=VTWvxg8eA@mail.gmail.com
Whole thread Raw
In response to Re: Having issues with tests  (Dave Cramer <pg@fastcrypt.com>)
Responses Re: Having issues with tests  (rapidtransit440@aol.com)
List pgsql-jdbc
Hi,

It seems difficult to help you on that case as its impossible to find the version you forked from and diffs you've made. Your git repo has no ref in common with our master repo and your fork seems to be old (source copyright year states 2011). Moreover, the unified diff between your sources and current pgjdbc master shows more than 26000 additions/deletions.

Alexis

2014-11-24 17:31 GMT+01:00 Dave Cramer <pg@fastcrypt.com>:
I run the tests regularly using ant -lib lib test and it runs fine. Have you tried that ?

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca

On 24 November 2014 at 11:04, <rapidtransit440@aol.com> wrote:
Version 9.3.4



-----Original Message-----
From: Dave Cramer <pg@fastcrypt.com>
To: rapidtransit440 <rapidtransit440@aol.com>
Cc: List <pgsql-jdbc@postgresql.org>
Sent: Mon, Nov 24, 2014 8:21 am
Subject: Re: [JDBC] Having issues with tests

What version of postgres are you running this on ?

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca

On 23 November 2014 at 11:04, <rapidtransit440@aol.com> wrote:
I recently forked Postgresql JDBC  to use some unsafe methods to get char arrays

This was before:
  41.8% - 462 ms - 4 inv. com.zaxxer.hikari.proxy.ConnectionJavassistProxy.prepareStatement
  41.8% - 462 ms - 4 inv. com.zaxxer.hikari.proxy.ConnectionProxy.prepareStatement
  41.8% - 462 ms - 4 inv. java.sql.Connection.prepareStatement
  41.8% - 462 ms - 4 inv. org.postgresql.jdbc2.AbstractJdbc2Connection.prepareStatement
  41.8% - 462 ms - 4 inv. org.postgresql.jdbc3.AbstractJdbc3Connection.prepareStatement
  41.8% - 462 ms - 4 inv. org.postgresql.jdbc4.Jdbc4Connection.prepareStatement
  41.8% - 462 ms - 4 inv. org.postgresql.jdbc4.Jdbc4PreparedStatement.<init>
  41.8% - 462 ms - 4 inv. org.postgresql.jdbc4.Jdbc4PreparedStatement.<init>
  41.8% - 462 ms - 4 inv. org.postgresql.jdbc4.Jdbc4Statement.<init>
  41.8% - 462 ms - 4 inv. org.postgresql.jdbc4.AbstractJdbc4Statement.<init>
  41.8% - 462 ms - 4 inv. org.postgresql.jdbc3g.AbstractJdbc3gStatement.<init>
  41.8% - 462 ms - 4 inv. org.postgresql.jdbc3.AbstractJdbc3Statement.<init>
  41.8% - 462 ms - 4 inv. org.postgresql.jdbc2.AbstractJdbc2Statement.<init>
  40.3% - 445 ms - 4 inv. org.postgresql.core.v3.QueryExecutorImpl.createParameterizedQuery
  40.3% - 445 ms - 4 inv. org.postgresql.core.v3.QueryExecutorImpl.parseQuery
  40.2% - 445 ms - 4 inv. java.lang.String.toCharArray <------(Yeah seriously)

I forgot to print the after but the after, my slowest method was StringBuffer.toString() in the after

Even before and after my changes I kept getting failed tests (I skipped SSL tests for now because I still can't figure out TestNG's @Provider annotation)


1. This is obvious I can fix myself:
\build.xml (The system cannot find the file specified)
java.io.FileNotFoundException: \build.xml (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:93)
at org.postgresql.test.jdbc2.BlobTest.compareBlobsLOAPI(BlobTest.java:270)
at org.postgresql.test.jdbc2.BlobTest.testUploadBlob_LOOP(BlobTest.java:119)

2. This is obvious I can fix myself
\build.xml (The system cannot find the file specified)
java.io.FileNotFoundException: \build.xml (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:93)
at org.postgresql.test.jdbc2.BlobTest.compareBlobs(BlobTest.java:312)
at org.postgresql.test.jdbc2.BlobTest.testUploadBlob_NATIVE(BlobTest.java:133)


3. No clue
expected [0] but found [-1]
java.lang.AssertionError: expected [0] but found [-1]
at org.testng.Assert.fail(Assert.java:94)
at org.testng.Assert.failNotEquals(Assert.java:494)
at org.testng.Assert.assertEquals(Assert.java:123)
at org.testng.Assert.assertEquals(Assert.java:370)
at org.testng.Assert.assertEquals(Assert.java:380)
at org.postgresql.test.jdbc4.PGCopyInputStreamTest.testReadBytesCorrectlyHandlesEof(PGCopyInputStreamTest.java:45)


4. This one is weird  if I run it separate it works
ERROR: could not determine data type of parameter $1
org.postgresql.util.PSQLException: ERROR: could not determine data type of parameter $1
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2100)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1839)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:249)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:550)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:418)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:412)
at org.postgresql.test.jdbc2.PreparedStatementTest.testComments(PreparedStatementTest.java:406)


5. This one is weird  if I run it separate it works
ERROR: could not determine data type of parameter $1
org.postgresql.util.PSQLException: ERROR: could not determine data type of parameter $1
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2100)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1839)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:249)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:550)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:418)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:412)
at org.postgresql.test.jdbc2.PreparedStatementTest.testDollarQuotes(PreparedStatementTest.java:359)


5. This is obvious
Large Objects may not be used in auto-commit mode.
org.postgresql.util.PSQLException: Large Objects may not be used in auto-commit mode.
at org.postgresql.largeobject.LargeObjectManager.createLO(LargeObjectManager.java:287)
at org.postgresql.largeobject.LargeObjectManager.createLO(LargeObjectManager.java:275)
at org.postgresql.jdbc2.AbstractJdbc2Statement.setBinaryStream(AbstractJdbc2Statement.java:1536)
at org.postgresql.jdbc2.AbstractJdbc2Statement.setAsciiStream(AbstractJdbc2Statement.java:1467)
at org.postgresql.test.jdbc2.PreparedStatementTest.doSetAsciiStream(PreparedStatementTest.java:175)
at org.postgresql.test.jdbc2.PreparedStatementTest.testSetAsciiStream(PreparedStatementTest.java:79)


6. No clue
ERROR: column "bin" is of type bytea but expression is of type oid
  Hint: You will need to rewrite or cast the expression.
  Position: 43
org.postgresql.util.PSQLException: ERROR: column "bin" is of type bytea but expression is of type oid
  Hint: You will need to rewrite or cast the expression.
  Position: 43
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2100)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1839)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:249)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:550)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:418)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:368)
at org.postgresql.test.jdbc2.PreparedStatementTest.doSetBinaryStream(PreparedStatementTest.java:168)
at org.postgresql.test.jdbc2.PreparedStatementTest.testSetBinaryStream(PreparedStatementTest.java:58)


7. No clue
Should have failed with type mismatch.
java.lang.AssertionError: Should have failed with type mismatch.
at org.testng.Assert.fail(Assert.java:94)
at org.postgresql.test.jdbc2.PreparedStatementTest.testUnknownSetObject(PreparedStatementTest.java:768)


8. No clue
ERROR: column "data" is of type bytea but expression is of type bigint
  Hint: You will need to rewrite or cast the expression.
  Position: 46
org.postgresql.util.PSQLException: ERROR: column "data" is of type bytea but expression is of type bigint
  Hint: You will need to rewrite or cast the expression.
  Position: 46
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2100)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1839)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:249)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:550)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:418)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:368)
at org.postgresql.test.jdbc2.ServerCursorTest.createRows(ServerCursorTest.java:46)
at org.postgresql.test.jdbc2.ServerCursorTest.testBasicFetch(ServerCursorTest.java:54)


9. No clue
ERROR: column "data" is of type bytea but expression is of type bigint
  Hint: You will need to rewrite or cast the expression.
  Position: 46
org.postgresql.util.PSQLException: ERROR: column "data" is of type bytea but expression is of type bigint
  Hint: You will need to rewrite or cast the expression.
  Position: 46
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2100)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1839)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:249)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:550)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:418)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:368)
at org.postgresql.test.jdbc2.ServerCursorTest.createRows(ServerCursorTest.java:46)
at org.postgresql.test.jdbc2.ServerCursorTest.testBinaryFetch(ServerCursorTest.java:73)


10. No clue
ERROR: column "data" is of type bytea but expression is of type bigint
  Hint: You will need to rewrite or cast the expression.
  Position: 41
org.postgresql.util.PSQLException: ERROR: column "data" is of type bytea but expression is of type bigint
  Hint: You will need to rewrite or cast the expression.
  Position: 41
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2100)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1839)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:249)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:550)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:418)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:368)
at org.postgresql.test.jdbc2.ServerPreparedStmtTest.testBytea(ServerPreparedStmtTest.java:230)


11. No clue
ERROR: invalid input syntax for integer: "test string"
org.postgresql.util.PSQLException: ERROR: invalid input syntax for integer: "test string"
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2100)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1839)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:249)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:550)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:418)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:311)
at org.postgresql.test.jdbc2.ServerPreparedStmtTest.testTypeChange(ServerPreparedStmtTest.java:286)


12. Not gonna fix yet
Can't invoke public void org.postgresql.test.ssl.SslTest.runTest() throws java.lang.Throwable: either make it static or add a no-args constructor to your class
org.testng.TestNGException: 
Can't invoke public void org.postgresql.test.ssl.SslTest.runTest() throws java.lang.Throwable: either make it static or add a no-args constructor to your class
at org.testng.internal.Utils.checkInstanceOrStatic(Utils.java:795)

13. No clue
ERROR: column "bin" is of type bytea but expression is of type bigint
  Hint: You will need to rewrite or cast the expression.
  Position: 65
org.postgresql.util.PSQLException: ERROR: column "bin" is of type bytea but expression is of type bigint
  Hint: You will need to rewrite or cast the expression.
  Position: 65
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2100)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1839)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:249)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:550)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:418)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:368)
at org.postgresql.jdbc2.AbstractJdbc2ResultSet.insertRow(AbstractJdbc2ResultSet.java:849)
at org.postgresql.test.jdbc2.UpdateableResultTest.testUpdateStreams(UpdateableResultTest.java:225)

If anyone could help it would be greatly appreciated, I used gradle so all you have to do is: "gradlew test" you don't need to have Groovy or Gradle installed 
Connection properties are set in src/test/resources/test.properties





pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: Having issues with tests
Next
From: Guillaume Cottenceau
Date:
Subject: performance question: protocol v2 vs v3