Skip to content

Make DST-sensitive and timing-sensitive tests robust - #4325

Closed
360608 wants to merge 1 commit into
flowable:mainfrom
360608:CP-fix-dst-tests
Closed

360608 wants to merge 1 commit into
flowable:mainfrom
360608:CP-fix-dst-tests

Conversation

@360608

@360608 360608 commented Oct 30, 2026

Copy link
Copy Markdown

Some tests fail depending on the date or machine load. None of them are related to the product code.

CallActivityTypeConversionTest and the CMMN TypeConversionTest
They assert that a P10D period converted to a date is between 239h and 240h01m from now. DefaultVariableValueConversionHandler adds a Period to a ZonedDateTime in calendar days, so when the 10 days cross a daylight saving change the span is 241h (or 239h) and the assertions fail. Right now (US DST ends on Nov 1) they fail on main.

The tests now compute the expected end with ZonedDateTime.now().plus(Period.ofDays(10)) and assert that the result is within one minute of it. This is stricter than the previous one hour window, and it is independent of the time zone and date.

BoundaryTimerEventTest
Three tests assert that the timer due date is within 100 ms of a timestamp taken before the process is started. That only holds when process start-up is very fast; it failed once for me under load (testRescheduleRepeatBoundaryTimer) and passed on rerun. The tolerance is now 5 seconds. The tests still check that the timer is due about one hour out.

Verification
CallActivityTypeConversionTest fails on current main and passes with this change. Passing with the change: CallActivityTypeConversionTest (2), TypeConversionTest (3) and BoundaryTimerEventTest (25).

CallActivityTypeConversionTest and the CMMN TypeConversionTest asserted that a 10 day period is between 239h and 240h01m from now. A period is added in calendar days, so the span is 241h when it crosses a DST change, and the tests fail for the days before it. Compute the expected end with ZonedDateTime.plus(Period) and assert it is within a minute.

BoundaryTimerEventTest asserted the timer due date is within 100 ms of a timestamp taken before the process start, which fails on a loaded machine. Allow 5 seconds.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@filiphr

filiphr commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

@360608 this is already handled in #4316. So I am going to close this PR

@filiphr filiphr closed this Oct 30, 2026
@360608
360608 deleted the CP-fix-dst-tests branch October 30, 2026 15:09
@360608

360608 commented Oct 30, 2026

Copy link
Copy Markdown
Author

@filiphr Thanks! I do see thought that the BoundaryTimerEventTest flakiness isn't in the PR you mentioned though, I've added a PR to hopefully address that. Please see:
#4326

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