Skip to content

Fix recurring tasks not running within timezone shadow #62

@emyller

Description

@emyller

The following test usually passes under daylight. Right now — it's evening — after glancing at the code, my best guess is that the time zone somehow affects behavior.

tests/unit/task_processor/test_unit_task_processor_models.py::test_recurring_task_run_should_execute_first_run_at[first_run_time1-False] FAILED       [1/1]
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> traceback >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

first_run_time = datetime.time(0, 44, 41, 506850), expected = False

    @pytest.mark.parametrize(
        "first_run_time, expected",
        ((one_hour_ago.time(), True), (one_hour_from_now.time(), False)),
    )
    def test_recurring_task_run_should_execute_first_run_at(
        first_run_time: time,
        expected: bool,
    ) -> None:
>       assert (
            RecurringTask(
                first_run_time=first_run_time,
                run_every=timedelta(days=1),
            ).should_execute
            == expected
        )
E       assert True == False
E        +  where True = <RecurringTask: RecurringTask object (None)>.should_execute
E        +    where <RecurringTask: RecurringTask object (None)> = RecurringTask(first_run_time=datetime.time(0, 44, 41, 506850), run_every=datetime.timedelta(days=1))
E        +      where datetime.timedelta(days=1) = timedelta(days=1)

tests/unit/task_processor/test_unit_task_processor_models.py:65: AssertionError

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions