cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti build requirements

mmaker1234
Champ in-the-making
Champ in-the-making
Hello Activiti developers,

I need to make some changes to the Activiti 5.11 sources. Unfortunately I have problems building it - some tests fail. What is strange, though, on each build different set of tests fail. That is why I tried to build the original, unmodified, sources.

Here are (excerpts from) the results of consecutive builds of the original source code:
C:\Projects\open_src\activiti-5.11_src\modules\activiti-engine>mvn install
[INFO] Scanning for projects…

Results :

Failed tests:
  testQueryDateVariable(org.activiti.engine.test.api.runtime.ExecutionQueryTest)
  testQueryDateVariable(org.activiti.engine.test.api.runtime.ProcessInstanceQueryTest)
  testCompetingJobAcquisitions(org.activiti.engine.test.concurrency.CompetingJobAcquisitionTest)

Tests run: 1041, Failures: 3, Errors: 0, Skipped: 0
C:\Projects\open_src\activiti-5.11_src\modules\activiti-engine>mvn clean install
[INFO] Scanning for projects…
Results :

Failed tests:
  testQueryDateVariable(org.activiti.engine.test.api.runtime.ProcessInstanceQueryTest)

Tests run: 1041, Failures: 1, Errors: 0, Skipped: 0
C:\Projects\open_src\activiti-5.11_src\modules\activiti-engine>mvn clean install
[INFO] Scanning for projects…

Running org.activiti.engine.test.bpmn.event.timer.StartTimerEventTest
[INFO] ————————————————————————
[INFO] BUILD FAILURE
[INFO] ————————————————————————

Strangely, as you can see, there was no results summary. The failed test is org.activiti.engine.test.api.runtime.ExecutionQueryTest
C:\Projects\open_src\activiti-5.11_src\modules\activiti-engine>mvn clean install
[INFO] Scanning for projects…

Results :

Tests run: 1041, Failures: 0, Errors: 0, Skipped: 0
Hooray, success!
C:\Projects\open_src\activiti-5.11_src\modules\activiti-engine>mvn clean install
[INFO] Scanning for projects…

Results :

Failed tests:
  testQueryDateVariable(org.activiti.engine.test.api.runtime.ExecutionQueryTest)
  testCompetingJobAcquisitions(org.activiti.engine.test.concurrency.CompetingJobAcquisitionTest)

Tests run: 1041, Failures: 2, Errors: 0, Skipped: 0
There were no changes in the code between the builds - just dumb start of the build. The builds were run in one console, i.e. in one and the same environment. The only difference might be that the console was not always on the top during the build and test process because I did other work, not at all related to Activiti, as the computer is my development one.

It seems there are some peculiarities of the build process, hence I would like to start with the dumbest question: What are the requirements (except the dependencies) to build Activiti 5.11 ?
7 REPLIES 7

mmaker1234
Champ in-the-making
Champ in-the-making
Hello moderators,

Please move this topic to the Developers forum. I posted it in the Users forum by mistake.

Best Regards,
Monique

trademak
Star Contributor
Star Contributor
Hi,

That's really strange. Are you using the default in-memory H2 database or did you change something there?
We have a QA environment where we run all tests on several db's and we don't experience this.

Best regards,

mmaker1234
Champ in-the-making
Champ in-the-making
Hello Tijs,

As we have no any experience with Maven here we do not even try to change the build configuration. The builds are run in the configuration as it is published with the sources. I think it is in-memory H2 DB.

To be honest I don't even know how to build the activiti-engine.jar without running the tests. In this particular case the changes are in the SQL scripts, which are not covered by the tests, so running them during the build is meaningless (again, in this particular case).

Oh, I forgot to mention that I'm building on Windows XP, Java 1.6.0_35, and Maven 3.0.3 if this makes any sense to you.

Unfortunately I didn't managed to attach about 20 KiB ZIP file with the full log of the builds and the sure-fire logs for the last two failed tests - I continuously receive an error like "Could not upload attachment to ./files/3644_a31938457a41ea23cfbe0b47fd8b6ca8." If you need these logs please tell me how to deliver them to you.

jbarrez
Star Contributor
Star Contributor
You can always build, skipping the tests by adding -DskipTests=true or -Dmaven.test.skip=true

mmaker1234
Champ in-the-making
Champ in-the-making
Hello Tjis,

I accidentally found Ronald's comment on http://jira.codehaus.org/browse/ACT-234. Is it possible the problems observed by me to have the same source - slower/different way Windows works?

Here are test failure excerpts:
——————————————————————————-
Test set: org.activiti.engine.test.api.runtime.ExecutionQueryTest
——————————————————————————-
Tests run: 30, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 7.922 sec <<< FAILURE!
testQueryDateVariable(org.activiti.engine.test.api.runtime.ExecutionQueryTest)  Time elapsed: 0.328 sec  <<< FAILURE!
junit.framework.AssertionFailedError: expected:<2> but was:<3>
at junit.framework.Assert.fail(Assert.java:47)
at junit.framework.Assert.failNotEquals(Assert.java:283)
at junit.framework.Assert.assertEquals(Assert.java:64)
at junit.framework.Assert.assertEquals(Assert.java:195)
at junit.framework.Assert.assertEquals(Assert.java:201)
at org.activiti.engine.test.api.runtime.ExecutionQueryTest.testQueryDateVariable(ExecutionQueryTest.java:830)
——————————————————————————-
Test set: org.activiti.engine.test.api.runtime.ProcessInstanceQueryTest
——————————————————————————-
Tests run: 37, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 7.61 sec <<< FAILURE!
testQueryDateVariable(org.activiti.engine.test.api.runtime.ProcessInstanceQueryTest)  Time elapsed: 0.25 sec  <<< FAILURE!
junit.framework.AssertionFailedError: expected:<2> but was:<3>
at junit.framework.Assert.fail(Assert.java:47)
at junit.framework.Assert.failNotEquals(Assert.java:283)
at junit.framework.Assert.assertEquals(Assert.java:64)
at junit.framework.Assert.assertEquals(Assert.java:195)
at junit.framework.Assert.assertEquals(Assert.java:201)
at org.activiti.engine.test.api.runtime.ProcessInstanceQueryTest.testQueryDateVariable(ProcessInstanceQueryTest.java:812)
——————————————————————————-
Test set: org.activiti.engine.test.concurrency.CompetingJobAcquisitionTest
——————————————————————————-
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.062 sec <<< FAILURE!
testCompetingJobAcquisitions(org.activiti.engine.test.concurrency.CompetingJobAcquisitionTest)  Time elapsed: 0.062 sec  <<< FAILURE!
junit.framework.AssertionFailedError: null
at junit.framework.Assert.fail(Assert.java:47)
at junit.framework.Assert.assertTrue(Assert.java:20)
at junit.framework.Assert.assertNotNull(Assert.java:214)
at junit.framework.Assert.assertNotNull(Assert.java:207)
at org.activiti.engine.test.concurrency.CompetingJobAcquisitionTest.testCompetingJobAcquisitions(CompetingJobAcquisitionTest.java:75)

I think the reason for the stochastic failures in ExecutionQueryTest is the following piece of code
739    Date date1 = Calendar.getInstance().getTime();
740    vars.put("dateVar", date1);
741   
742    ProcessInstance processInstance1 = runtimeService.startProcessInstanceByKey("oneTaskProcess", vars);
743   
744    Date date2 = Calendar.getInstance().getTime();
because, depending on the OS time-resolution (and other "optimization" factors), date1 and date2 could have the same value - the "distance" between them seems to be too small.

Except if the small time difference is in the core of the test, I would propose to ("artificially", intentionally) add one hour to date2. I didn't tracked all the consequences of such a change but at first glance it seems to have no impact on the rest of the test.

The failed test code in ProcessInstanceQueryTest seems very similar to the one in ExecutionQueryTest.

I do not feel confident enough to comment on the failure reasons for CompetingJobAcquisitionTest.

Best Regards,
Monique

P.S. I tried to attach the builds log and test failure logs in 7z format but again hit "Could not upload attachment to ./files/3644_b88e0466ea0298f3c62d2e8088cf6e9c." What kind of files are allowed as attachments in this forum?

mmaker1234
Champ in-the-making
Champ in-the-making
Hello again,

I would like to report that adding
744    Date date2 = Calendar.getInstance().getTime();
745    date2.setTime( date2.getTime() + 1000 ); //Add one second to explicitly distinguish from 'date1'
to ExecutionQueryTest and ProcessInstanceQueryTest (after row 726) solved the problems with these two tests - five consecutive builds passed them.

Unfortunately the problem with CompetingJobAcquisitionTest still exists - failed two out of five builds.

Now Activiti developers team need to tell if the change proposed for ExecutionQueryTest and ProcessInstanceQueryTest does not alter the mean of the tests.

trademak
Star Contributor
Star Contributor
Hi,

We have it on our todo list to make these test more robust.
Thanks for the pointers.

Best regards,