Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timeFromLastExecution with zoneId ignores november 3 #404

Open
andrelzorzo opened this issue Nov 3, 2019 · 10 comments
Open

timeFromLastExecution with zoneId ignores november 3 #404

andrelzorzo opened this issue Nov 3, 2019 · 10 comments

Comments

@andrelzorzo
Copy link

Not sure if this problem is related to issues #402 and #403 but using zoneid "America/Sao_Paulo" with a cron starting at midnight I just can't get a correct time for today (november 3).

This is the code, I'll also submit a pull request.

	final CronDefinition cronDefinition = CronDefinitionBuilder.defineCron().withMinutes().and().withHours().and()
		.withDayOfWeek().and().instance();
	final Cron cron = new CronParser(cronDefinition).parse("0 0 *");
	final ExecutionTime executionTime = ExecutionTime.forCron(cron);
	final ZonedDateTime time = LocalDateTime.of(2019, 11, 3, 0, 0, 1).atZone(ZoneId.of("America/Sao_Paulo"));
	final Duration timeFromLastExecution = executionTime.timeFromLastExecution(time).get();
	Assert.assertEquals(1, timeFromLastExecution.getSeconds());
@jmrozanec
Copy link
Owner

@brusazorzo thank you for reporting this. Best!

jmrozanec added a commit that referenced this issue Nov 5, 2019
@IndeedSi
Copy link

All tests for this issue are passing now. It might be fixed by some fixes on another daylight saving issue? @jmrozanec

@jmrozanec
Copy link
Owner

@IndeedSi not all tests are passing. Two are ignored, which require fixing.

@IndeedSi
Copy link

@jmrozanec Ah... I meant the two ignored tests were also passing in my local.

@jmrozanec
Copy link
Owner

jmrozanec commented Oct 13, 2020

@IndeedSi they are not passing in my local ... I just checked again with the latest changes, and found the test failing are Issue404Test::testNovember3Noon and Issue404Test::testNovember3Midnight. Is there any additional code that shall be pushed?

@IndeedSi
Copy link

IndeedSi commented Oct 13, 2020

@jmrozanec That's weird.... I tried to change my local timezone, still found these tests passing. Not sure how I can reproduce the problem here :( (I've got clean master branch, so no additional code in my local)

@pangyikhei
Copy link
Contributor

pangyikhei commented Oct 28, 2020

Issue404Test::testNovember3Noon and Issue404Test::testNovember3Midnight are also passing for me.

Tests were run on AdoptOpenJDK 8.0.242.08-hotspot.

Notably, Brazil seems to have stopped observing DST in 2019, and the update for the jdk for that is in 13.0.1, 11.0.5, 8u231, 7u241.

When I try to run the tests in JDK 8u202, the tests fail.

@jmrozanec
Copy link
Owner

jmrozanec commented Oct 28, 2020

@pangyikhei thank you for providing a second eye on this! Can we ensure this runs with gh-actions?

@pangyikhei
Copy link
Contributor

@jmrozanec Updated my previous comment with the possible cause of the test failures on your end.

@jmrozanec
Copy link
Owner

@pangyikhei thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants