You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to cover with tests some of mine CRON expressions i ran into an issue that WillFireOn method of CronTriggerImpl returns false when it shouldn't
Version used
.NET Core 3.1, Quartz 3.3.2
To Reproduce
Listed CRON expression is meant to fire everyday at 5:50, 11:50, 17:50 and 23:50 (all GMT)
I have created simple example of test where you can reproduce the issue. Assert.IsTrue fails, when the next line Assert.AreEqual passes the test that in fact the same thing and both should pass.
using NUnit.Framework;using Quartz;using Quartz.Impl.Triggers;using System;namespaceTestProject{publicclassTests{privatestaticreadonlyTimeSpanOffset= TimeZoneInfo.FindSystemTimeZoneById("GMT Standard Time").BaseUtcOffset;privatestaticreadonlyDateTimeStartDate=new DateTime(2021,1,1,0,0,0, DateTimeKind.Utc);privateconststringTimezoneGMT="GMT Standard Time";[Test]publicvoidTest_GMT_CRON(){vartrigger= TriggerBuilder.Create().WithIdentity("name", TriggerKey.DefaultGroup).WithCronSchedule("0 50 5,11,17,23 ? * *",x =>{ x.InTimeZone(TimeZoneInfo.FindSystemTimeZoneById(TimezoneGMT)); x.WithMisfireHandlingInstructionDoNothing();}).StartAt(StartDate).Build()as CronTriggerImpl;varexpected=new DateTimeOffset(StartDate.AddHours(5).AddMinutes(50), Offset);
Assert.IsTrue(trigger.WillFireOn(expected));
Assert.AreEqual(expected, trigger.GetFireTimeAfter(StartDate));}}}
Hi all
Trying to cover with tests some of mine CRON expressions i ran into an issue that
WillFireOn
method ofCronTriggerImpl
returnsfalse
when it shouldn'tVersion used
.NET Core 3.1, Quartz 3.3.2
To Reproduce
Listed CRON expression is meant to fire everyday at 5:50, 11:50, 17:50 and 23:50 (all GMT)
I have created simple example of test where you can reproduce the issue.
Assert.IsTrue
fails, when the next lineAssert.AreEqual
passes the test that in fact the same thing and both should pass.Assumption
I think the problem is in CronTriggerImpl.cs
At the very first line of the method it overwrites value of
test
losing offset in this case, so later it is not able to compare correctly.The text was updated successfully, but these errors were encountered: