-
1. Re: PostgeSQL runs take too long
tom.baeyens Sep 11, 2008 7:09 AM (in response to thomas.diesler)the first place to look for the cause is the db-recreation inbetween all tests.
at one time, to clean the db inbetween the tests, the key constraints were dropped and then a "delete from tablename" for all tables was done.
this might have changed to a create-drop of the full schema.
that is what should be checked first. recreation can be very costly. -
2. Re: PostgeSQL runs take too long
thomas.diesler Sep 11, 2008 10:04 AM (in response to thomas.diesler)Where in the config would that be?
http://anonsvn.jboss.org/repos/jbpm/jbpm3/trunk/modules/core/src/main/resources/ -
3. Re: PostgeSQL runs take too long
aguizar Sep 11, 2008 11:03 AM (in response to thomas.diesler)It ain't configuration, it is the AbstractDbTestCase code:
http://anonsvn.jboss.org/repos/jbpm/jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/AbstractDbTestCase.javapublic void setUp() throws Exception { createSchema(); // HERE createJbpmContext(); initializeMembers(); } public void tearDown() throws Exception { resetMembers(); closeJbpmContext(); dropSchema(); // AND HERE super.tearDown(); }
Note however that removing the above lines will be a challenge because many tests depend on an empty database. Perhaps we could simply clear the tables instead of dropping them? Of course that would imply caring about constraint violations. Not an easy way out either. -
4. Re: PostgeSQL runs take too long
thomas.diesler Sep 11, 2008 12:54 PM (in response to thomas.diesler)Thanks, this is good news.
I'd say we take the opposite approach and clear those lines and reinsert where actually needed. -
5. Re: PostgeSQL runs take too long
thomas.diesler Sep 11, 2008 7:13 PM (in response to thomas.diesler)Did some refactoring and removed the dropSchema() call in tearDown();
[tdiesler@tdvaio core]$ mvn -o -Ddatabase=postgresql test
...
Tests run: 982, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9 minutes 37 seconds
[INFO] Finished at: Fri Sep 12 01:10:25 CEST 2008
[INFO] Final Memory: 11M/42M
[INFO] ------------------------------------------------------------------------ -
6. Re: PostgeSQL runs take too long
thomas.diesler Sep 11, 2008 7:14 PM (in response to thomas.diesler)There are still some dropSchema() calls scattered around in test cases. Removing them should speed up things as well.
-
7. Re: PostgeSQL runs take too long
aguizar Sep 12, 2008 3:23 AM (in response to thomas.diesler)Down to 9 minutes from over 2 hours? Cool!