You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "abhijithumbe (via GitHub)" <gi...@apache.org> on 2025/03/27 09:29:25 UTC
[PR] Incubator-kie-issues-3871] Repeating timer gets executed immediately [incubator-kie-kogito-runtimes]
abhijithumbe opened a new pull request, #3872:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/3872
<!-- Please don't forget your Issue link -->
https://github.com/apache/incubator-kie-kogito-runtimes/issues/3871
<!-- Please provide a short description of what this PR does -->
Using timer node with timer expression R/PT5M, the job gets executed immediately, then in the configured 5min intervals.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] Incubator-kie-issues-3871] Repeating timer gets executed immediately [incubator-kie-kogito-runtimes]
Posted by "abduljaleelak (via GitHub)" <gi...@apache.org>.
abduljaleelak commented on code in PR #3872:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/3872#discussion_r2016195269
##########
jbpm/jbpm-flow/src/test/java/org/jbpm/process/core/timer/DateTimeUtilsTest.java:
##########
@@ -135,7 +135,7 @@ public void testParseRepeatablePeriodOnly() {
assertThat(parsedRepeatable[0]).isEqualTo(-1L);
// Default delay time is 1000ms
- assertThat(parsedRepeatable[1]).isEqualTo(1000L);
Review Comment:
If we need to cover this targeted logic, we can add below junit
```
@Test
public void testDefaultDelay() {
String isoString = "R/PT0M";
long[] parsedRepeatable = DateTimeUtils.parseRepeatableDateTime(isoString);
// Default delay time is 1000ms
assertThat(parsedRepeatable[1]).isEqualTo(1000L);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] Incubator-kie-issues-3871] Repeating timer gets executed immediately [incubator-kie-kogito-runtimes]
Posted by "abhijithumbe (via GitHub)" <gi...@apache.org>.
abhijithumbe commented on code in PR #3872:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/3872#discussion_r2024826927
##########
jbpm/jbpm-flow/src/test/java/org/jbpm/process/core/timer/DateTimeUtilsTest.java:
##########
@@ -135,7 +135,7 @@ public void testParseRepeatablePeriodOnly() {
assertThat(parsedRepeatable[0]).isEqualTo(-1L);
// Default delay time is 1000ms
- assertThat(parsedRepeatable[1]).isEqualTo(1000L);
Review Comment:
@martinweiler Thank you for looking into this. I have included additional tests as you suggested.Please take a look.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] Incubator-kie-issues-3871] Repeating timer gets executed immediately [incubator-kie-kogito-runtimes]
Posted by "martinweiler (via GitHub)" <gi...@apache.org>.
martinweiler commented on code in PR #3872:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/3872#discussion_r2016958793
##########
jbpm/jbpm-flow/src/test/java/org/jbpm/process/core/timer/DateTimeUtilsTest.java:
##########
@@ -135,7 +135,7 @@ public void testParseRepeatablePeriodOnly() {
assertThat(parsedRepeatable[0]).isEqualTo(-1L);
// Default delay time is 1000ms
- assertThat(parsedRepeatable[1]).isEqualTo(1000L);
Review Comment:
I think we should have the same test here as it was used in v7:
https://github.com/kiegroup/jbpm/blob/main/jbpm-flow/src/test/java/org/jbpm/process/core/timer/DateTimeUtilsTest.java#L126-L136
In the new syntax, this would be:
```
assertThat(parsedRepeatable[0]).isEqualTo(-1L);
assertThat(parsedRepeatable[1] <= MINUTE_IN_MILLISECONDS).as("Parsed delay is bigger than " + MINUTE_IN_MILLISECONDS).isTrue();
assertThat(parsedRepeatable[1] > FIFTY_NINE_SECONDS_IN_MILLISECONDS)
.as("Parsed delay is too low! Expected value is between " + MINUTE_IN_MILLISECONDS + " and " + FIFTY_NINE_SECONDS_IN_MILLISECONDS + " but is " + parsedRepeatable[1]).isTrue();
assertThat(parsedRepeatable[2]).as("Parsed period should be one minute in milliseconds but is " + parsedRepeatable[2]).isEqualTo(MINUTE_IN_MILLISECONDS);
```
Not directly linked to this change, but as you are on it, I think it might be a good idea to add the additional tests from v7 (starting in L138) to the codebase as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] Incubator-kie-issues-3871] Repeating timer gets executed immediately [incubator-kie-kogito-runtimes]
Posted by "pefernan (via GitHub)" <gi...@apache.org>.
pefernan merged PR #3872:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/3872
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org