dbader / schedule

Python job scheduling for humans.
https://schedule.readthedocs.io/
MIT License
11.73k stars 959 forks source link

test_until_time failing since 1.1.0 #488

Closed mweinelt closed 1 year ago

mweinelt commented 2 years ago

After upgrading to 1.1.0 we see the following test fail:

======================================================================
FAIL: test_until_time (test_schedule.SchedulerTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/schedule-1.1.0/test_schedule.py", line 317, in test_until_time
    self.assertRaises(ScheduleValueError, every().day.until, datetime.time(hour=5))
AssertionError: ScheduleValueError not raised by until

It was introduced in https://github.com/dbader/schedule/commit/1849e0165278f1cdfaf41972f73e02ecda4d09a6.

pgajdos commented 2 years ago

It is flaky it seems.

nekopsykose commented 2 years ago

given that this fails at, say, 4am localtime, and editing that hour=5 to hour=3 makes it pass instantly, and editing it back to =5 makes it consistently fail, i assume that is just setting current_date.hour, and so it is not 'in the past' as what it tries to test, and so doesn't fail as it's not invalid to schedule something just slightly in the future from localtime.

i could also be misunderstanding what it means, but based on the behaviour it seems to explain why it fails at a certain time of day

SijmenHuizenga commented 1 year ago

This has been resolved in #563. Thanks to everyone here for reporting and debugging! :rocket: