Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[master] Fixing some minor warnings and errors in JPA tests #364

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dazey3
Copy link
Contributor

@dazey3 dazey3 commented Jan 29, 2019

I loaded up some tests in Eclipse and there were several compile errors centered around identification vars in queries:

An identification variable must not have the same name as any entity in the same persistence unit

Seems fairly safe for me to change these queries minor issues and compile warnings

Signed-off-by: Will Dazey [email protected]

Copy link
Member

@lukasj lukasj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copyright year in headers of modified files should be updated to 2019

@dazey3
Copy link
Contributor Author

dazey3 commented Jan 31, 2019

@lukasj What is the reason why we update the year in the header each time we update a file? What if I just created a PR that updates all headers?
It feels similar to the convention we have where we add to the header the bug number + the author + description. But since we have GITs commit history, it feels rather superfluous.

@lukasj
Copy link
Member

lukasj commented Feb 1, 2019

@dazey3 short version: lawyers want it. long version - conversation starting with https://www.eclipse.org/lists/jakarta.ee-community/msg00970.html

@dazey3 dazey3 force-pushed the minorTestErrors branch 2 times, most recently from 6c0456f to da61dac Compare February 1, 2019 21:45
@dazey3
Copy link
Contributor Author

dazey3 commented Feb 1, 2019

I see it's still failing on org.eclipse.persistence.testing.tests.jpa21.advanced.JPA21TestSuite, but travis doesnt show me the exact test thats failing... and I cant get the test-lrg-server target running on my local env. Is there anyway I can get the exact tests failing? I'm sure its a minor mistake.

@dazey3 dazey3 force-pushed the minorTestErrors branch 4 times, most recently from 8cb4a92 to 98d756a Compare February 5, 2019 17:45
@dazey3
Copy link
Contributor Author

dazey3 commented Feb 6, 2019

I was cleaning up some tests in CriteriaQueryCastTestSuite and Ii found what looks like a bug, so I opened #366 to fix it. I'll just leave those specific tests commented out since they require a product fix.

@dazey3 dazey3 force-pushed the minorTestErrors branch 6 times, most recently from 3730275 to 1ff0226 Compare February 6, 2019 22:16
@dazey3
Copy link
Contributor Author

dazey3 commented Feb 7, 2019

@lukasj Can I get assistance with this build failure? I can't run the test-lrg-server target locally and when I run org.eclipse.persistence.testing.tests.jpa21.advanced.JPA21TestSuite locally (test-jpa21) the tests pass perfectly fine. The issue I am having is that the build tells me there were 20 errors, but I have no idea what those errors are. Is there a way for me to access the build results to look at the actual test results?

@lukasj
Copy link
Member

lukasj commented Feb 8, 2019

Following what travis does works on my end... In any case, there's unfortunately no way how to get better results from travis without additional scripting.
The error in TEST-org.eclipse.persistence.testing.tests.jpa21.advanced.JPA21TestSuite is:

  <testcase classname="org.eclipse.persistence.testing.tests.jpa21.advanced.CriteriaQueryCastTestSuite" name="testDowncastOneToManyLeafQueryKey" time="0.13">
    <error message="&#xa;Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table &apos;ecltests.JPA21_INHERITANCE_SEQ&apos; doesn&apos;t exist&#xa;Error Code: 1146" type="org.eclipse.persistence.exceptions.DatabaseException">Local Exception Stack: 
Exception [EclipseLink-4002] (Eclipse Persistence Services - 3.0.0.qualifier): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table &apos;ecltests.JPA21_INHERITANCE_SEQ&apos; doesn&apos;t exist
Error Code: 1146
	at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:334)

@dazey3
Copy link
Contributor Author

dazey3 commented Feb 8, 2019

Oh! I see. CriteriaQueryCastTestSuite had this in it's testSetup for some reason:

if (isOnServer()) {
    return;
}

None of the other testSetup implementations have this logic, so I am just going to remove it and assume it's not supposed to be there.

@dazey3
Copy link
Contributor Author

dazey3 commented Feb 8, 2019

Uggg! Well, I fixed that table creation issue (ty by the way), but now there are still 2 other failures. @lukasj Is there a way for me to access the travis results myself? Similar to access to https://hudson.eclipse.org/eclipselink/?

@lukasj
Copy link
Member

lukasj commented Feb 11, 2019

@dazey3 no, there is now way to access travis results for anyone. I'm always rerunning what fails myself on my box to get results. All I do is to execute commands found in .travis.yml. If you're on windows, I can check on Wed to see, what needs to be done to make it working there as well.

As for current failures:


  <testcase classname="org.eclipse.persistence.testing.tests.jpa21.advanced.CriteriaQueryCastTestSuite" name="testSetup" time="1.653">
    <error message="&#xa;Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Can&apos;t write; duplicate key in table &apos;#sql-1_33&apos;&#xa;Error Code: 1022" type="org.eclipse.persistence.exceptions.DatabaseException">Local Exception Stack: 
Exception [EclipseLink-4002] (Eclipse Persistence Services - 3.0.0.qualifier): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Can&apos;t write; duplicate key in table &apos;#sql-1_33&apos;
Error Code: 1022
	at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:334)
...
	at org.eclipse.persistence.tools.schemaframework.SchemaManager.createForeignConstraints(SchemaManager.java:194)
	at org.eclipse.persistence.tools.schemaframework.TableCreator.createConstraints(TableCreator.java:125)
	at org.eclipse.persistence.tools.schemaframework.TableCreator.createTables(TableCreator.java:198)
	at org.eclipse.persistence.tools.schemaframework.TableCreator.replaceTablesAndConstraints(TableCreator.java:363)
	at org.eclipse.persistence.tools.schemaframework.TableCreator.replaceTables(TableCreator.java:351)
	at org.eclipse.persistence.tools.schemaframework.TableCreator.replaceTables(TableCreator.java:335)
	at org.eclipse.persistence.tools.schemaframework.TableCreator.replaceTables(TableCreator.java:327)
	at org.eclipse.persistence.testing.framework.TogglingFastTableCreator.replaceTables(TogglingFastTableCreator.java:119)
	at org.eclipse.persistence.testing.models.jpa21.advanced.inheritance.InheritanceTableCreator.replaceTables(InheritanceTableCreator.java:2470)
	at org.eclipse.persistence.testing.tests.jpa21.advanced.CriteriaQueryCastTestSuite.testSetup(CriteriaQueryCastTestSuite.java:122)
	at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.runBareServer(JUnitTestCase.java:789)
...
	at java.lang.Thread.run(Thread.java:748)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Can&apos;t write; duplicate key in table &apos;#sql-1_33&apos;
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
...
</error>
  </testcase>

  <testcase classname="org.eclipse.persistence.testing.tests.jpa21.advanced.CriteriaQueryCastTestSuite" name="testDowncastSingleTableQueryKey" time="0.048">
    <error message="Exception [EclipseLink-4002] (Eclipse Persistence Services - 3.0.0.qualifier): org.eclipse.persistence.exceptions.DatabaseException&#xa;Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table &apos;ecltests.JPA21_CONSUMER&apos; doesn&apos;t exist&#xa;Error Code: 1146&#xa;Call: INSERT INTO JPA21_CONSUMER (ID, NAME, VERSION, DTYPE) VALUES (?, ?, ?, ?)&#xa;&#x9;bind =&gt; [4 parameters bound]&#xa;Query: InsertObjectQuery(org.eclipse.persistence.testing.models.jpa21.advanced.inherited.BeerConsumer@241382c4)" type="javax.persistence.PersistenceException">javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 3.0.0.qualifier): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table &apos;ecltests.JPA21_CONSUMER&apos; doesn&apos;t exist
Error Code: 1146
Call: INSERT INTO JPA21_CONSUMER (ID, NAME, VERSION, DTYPE) VALUES (?, ?, ?, ?)
	bind =&gt; [4 parameters bound]
Query: InsertObjectQuery(org.eclipse.persistence.testing.models.jpa21.advanced.inherited.BeerConsumer@241382c4)
	at org.eclipse.persistence.internal.jpa.EntityManagerImpl.flush(EntityManagerImpl.java:975)
	at org.jboss.as.jpa.container.AbstractEntityManager.flush(AbstractEntityManager.java:459)
	at org.eclipse.persistence.testing.tests.jpa21.advanced.CriteriaQueryCastTestSuite.testDowncastSingleTableQueryKey(CriteriaQueryCastTestSuite.java:534)
	at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.runBareServer(JUnitTestCase.java:789)
...
	at java.lang.Thread.run(Thread.java:748)
Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 3.0.0.qualifier): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table &apos;ecltests.JPA21_CONSUMER&apos; doesn&apos;t exist
Error Code: 1146
	at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:334)
...
	at org.eclipse.persistence.internal.jpa.EntityManagerImpl.flush(EntityManagerImpl.java:970)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table &apos;ecltests.JPA21_CONSUMER&apos; doesn&apos;t exist
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
...
</error>
  </testcase>

@dazey3
Copy link
Contributor Author

dazey3 commented Feb 11, 2019

Thanks again for the info @lukasj ! These seem a bit harder to figure out compared to the first one which was fairly obvious now.

jpa21.advanced.CriteriaQueryCastTestSuite.testSetup():
Error: Can't write; duplicate key in table '#sql-1_33'
Where is this table name sql-1_33 even coming from?? This issue seems like a bigger issue than I can figure out with just this error message. Why can I not reproduce this error locally when running ant antbuild.xml clean build test-jpa21?

jpa21.advanced.CriteriaQueryCastTestSuite.testDowncastSingleTableQueryKey():
Error: Table 'ecltests.JPA21_CONSUMER' doesn't exist

This is probably related to the fact that testSetup failed and InheritedTableManager().replaceTables is not run as part of testSetup. Though, I would have expected more than just this one test failure when none of the Inherited tables are created!

@lukasj
Copy link
Member

lukasj commented Feb 11, 2019

antbuild.xml clean build test-jpa21 does not run server-side tests, antbuild.xml clean build test-lrg-server (or alternatives - see this target for details) should be used instead.

#sql-1_33 table is supposed to be some db internal table containing foreign constraints for some table. What you can try is to look into jpa/eclipselink.jpa.test/build-server/ folder, look fo r model name which is failing and check war/jar files there

@dazey3 dazey3 force-pushed the minorTestErrors branch 2 times, most recently from 43f5db6 to e7f3707 Compare April 5, 2019 21:30
@dazey3 dazey3 force-pushed the minorTestErrors branch 4 times, most recently from 6c3f176 to e238532 Compare April 10, 2019 03:36
@lukasj
Copy link
Member

lukasj commented Sep 26, 2019

@dazey3 can you rebase this, please, and see what happens in current master?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants