Unit test errors when building from source

When downloading the source from GitHub - camunda/camunda-bpm-platform: Flexible framework for workflow and decision automation with BPMN and DMN. Integration with Spring, Spring Boot, CDI. (both Master and 7.13.0 branches) and executing (after modifying settings.xml to use camunda-bpm profile)

mvn clean install

The following errors always occur:

Tests run: 25, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.058 s <<< FAILURE! - in org.camunda.bpm.dmn.engine.type.DmnDataTypeTransformerTest
shouldTransformZonedDateTime(org.camunda.bpm.dmn.engine.type.DmnDataTypeTransformerTest)  Time elapsed: 0.007 s  <<< FAILURE!
java.lang.AssertionError:

Expected: is <Value 'Fri Sep 18 12:00:00 EDT 2015' of type 'PrimitiveValueType[date]', isTransient=false>
     but: was <Value 'Fri Sep 18 06:00:00 EDT 2015' of type 'PrimitiveValueType[date]', isTransient=false>
        at org.camunda.bpm.dmn.engine.type.DmnDataTypeTransformerTest.shouldTransformZonedDateTime(DmnDataTypeTransformerTest.java:248)

Any ideas why?
Thanks.

Bump !
Shouldn’t the source be error free?

I did a build of camunda-bpm-platform master last Saturday, and it was error free.
Which environment you’re using?
Operating-System ?
JDK-Version ?
Database system?

1 Like

This test seems to be incorrect when used in timezone different than Europe/Berlin.
A date without timezone information is compared to a timestamp including a timezone.
This leads to the 6 hour difference between expected value and determined value.

  @Test
  public void shouldTransformZonedDateTime() {
    // given
    DmnDataTypeTransformer typeTransformer = registry.getTransformer("date");

    Date date = toDate("2015-09-18T12:00:00");
    TypedValue dateValue = Variables.dateValue(date);
    ZonedDateTime zonedDateTime = ZonedDateTime.of(2015, 9, 18, 12, 0, 0, 0, ZoneId.of("Europe/Berlin"));

    // when
    TypedValue transformedFromZonedDateTime = typeTransformer.transform(zonedDateTime);

    // then
    assertThat(transformedFromZonedDateTime, is(dateValue));
  }
1 Like

Thanks !
here is the info:

  • OS: MacOSX 10.15.4
  • JDK: openjdk version “1.8.0_242”
    OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_242-b08)
    OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.242-b08, mixed mode)
  • Database: N/A it shouldn’t be needed to build from source, right?

Hi @serram,

I agree with Frank:

Please feel free to create a ticket for it or raise a pull request to adjust the test to be timezone independent.

Best regards,
Yana

Jira created: https://jira.camunda.com/browse/CAM-12139
Pull request: chore(engine-dmn/test): Fix test DmnDataTypeTransformerTest.shouldTransformZonedDateTime. by langfr · Pull Request #889 · camunda/camunda-bpm-platform · GitHub

1 Like

@langfr Please note that this is not the only error, there are more:

ERROR] Failures:
[ERROR]   HistoryCleanupSchedulerActivityInstancesTest.shouldScheduleToLater:137
Expected: is <Sat Mar 23 08:00:10 EDT 2013>
     but: was <Sat Mar 23 13:00:00 EDT 2013>
[ERROR]   HistoryCleanupSchedulerAttachmentsTest.shouldScheduleToLater:155
Expected: is <Sat Mar 23 08:00:10 EDT 2013>
     but: was <Sat Mar 23 13:00:00 EDT 2013>
[ERROR] org.camunda.bpm.engine.test.api.history.removaltime.cleanup.HistoryCleanupSchedulerAuthorizationsTest.shouldScheduleToLater(org.camunda.bpm.engine.test.api.history.removaltime.cleanup.HistoryCleanupSchedulerAuthorizationsTest)
[ERROR]   Run 1: HistoryCleanupSchedulerAuthorizationsTest.shouldScheduleToLater:160
Expected: is <Sat Mar 23 08:00:10 EDT 2013>
     but: was <Sat Mar 23 13:00:00 EDT 2013>
[ERROR]   Run 2: HistoryCleanupSchedulerAuthorizationsTest.shouldScheduleToLater Database is not clean:
Table: ACT_RU_AUTHORIZATION contains: 5 rows

[INFO]
[ERROR]   HistoryCleanupSchedulerBatchesTest.shouldScheduleToLater:180
Expected: is <Sat Mar 23 08:00:10 EDT 2013>
     but: was <Sat Mar 23 13:00:00 EDT 2013>
[ERROR]   HistoryCleanupSchedulerCommentsTest.shouldScheduleToLater:153
Expected: is <Sat Mar 23 08:00:10 EDT 2013>
     but: was <Sat Mar 23 13:00:00 EDT 2013>
[ERROR]   HistoryCleanupSchedulerDecisionsTest.shouldScheduleToLaterByDecisionInputs:148
Expected: is <Sat Mar 23 08:00:10 EDT 2013>
     but: was <Sat Mar 23 13:00:00 EDT 2013>
[ERROR]   HistoryCleanupSchedulerDecisionsTest.shouldScheduleToLaterByDecisionOutputs:208
Expected: is <Sat Mar 23 08:00:10 EDT 2013>
     but: was <Sat Mar 23 13:00:00 EDT 2013>
[ERROR]   HistoryCleanupSchedulerDetailsTest.shouldScheduleToLater:148
Expected: is <Sat Mar 23 08:00:10 EDT 2013>
     but: was <Sat Mar 23 13:00:00 EDT 2013>
[ERROR]   HistoryCleanupSchedulerExternalTaskLogsTest.shouldScheduleToLater:163
Expected: is <Sat Mar 23 08:00:10 EDT 2013>
     but: was <Sat Mar 23 13:00:00 EDT 2013>
[ERROR]   HistoryCleanupSchedulerIdentityLinkLogsTest.shouldScheduleToLater:144
Expected: is <Sat Mar 23 08:00:10 EDT 2013>
     but: was <Sat Mar 23 13:00:00 EDT 2013>
[ERROR]   HistoryCleanupSchedulerIncidentsTest.shouldScheduleToLater:172
Expected: is <Sat Mar 23 08:00:10 EDT 2013>
     but: was <Sat Mar 23 13:00:00 EDT 2013>
[ERROR]   HistoryCleanupSchedulerJobLogTest.shouldScheduleToLater:168
Expected: is <Sat Mar 23 08:00:10 EDT 2013>
     but: was <Sat Mar 23 13:00:00 EDT 2013>
[ERROR]   HistoryCleanupSchedulerProcessInstancesTest.shouldScheduleToLater:142
Expected: is <Sat Mar 23 08:00:10 EDT 2013>
     but: was <Sat Mar 23 13:00:00 EDT 2013>
[ERROR]   HistoryCleanupSchedulerTaskInstancesTest.shouldScheduleToLater:147
Expected: is <Sat Mar 23 08:00:10 EDT 2013>
     but: was <Sat Mar 23 13:00:00 EDT 2013>
[ERROR]   HistoryCleanupSchedulerUserOperationLogsTest.shouldScheduleToLater:156
Expected: is <Sat Mar 23 08:00:10 EDT 2013>
     but: was <Sat Mar 23 13:00:00 EDT 2013>
[ERROR]   HistoryCleanupSchedulerVariableInstancesTest.shouldScheduleToLater:146
Expected: is <Sat Mar 23 08:00:10 EDT 2013>
     but: was <Sat Mar 23 13:00:00 EDT 2013>
[ERROR]   CompetingHistoryCleanupAcquisitionTest>AbstractProcessEngineTestCase.runBare:115->testAcquiringEverLivingJobSucceeds:116 expected:<2013-03-18T[08:00:1]0.000> but was:<2013-03-18T[12:00:0]0.000>
[ERROR]   CompetingHistoryCleanupAcquisitionTest>AbstractProcessEngineTestCase.runBare:115->testReschedulingEverLivingJobSucceeds:160 expected:<2013-03-18T[08:00:1]0.000> but was:<2013-03-18T[12:00:0]0.000>
[ERROR] Errors:
[ERROR]   AsyncEmailTaskTest>AbstractProcessEngineTestCase.runBare:115->testSimpleTextMail:42->AbstractProcessEngineTestCase.waitForJobExecutorToProcessAllJobs:280 » ProcessEngine
[ERROR]   AsyncEmailTaskTest>AbstractProcessEngineTestCase.runBare:115->testSimpleTextMailSendTask:61->AbstractProcessEngineTestCase.waitForJobExecutorToProcessAllJobs:280 » ProcessEngine
[INFO]
[ERROR] Tests run: 14390, Failures: 18, Errors: 2, Skipped: 29

Basically, the build should work in any timezone outside Europe/Berlin