E
E
Edward2017-01-31 17:41:17
linux
Edward, 2017-01-31 17:41:17

How to test cron tasks in Docker? (how to speed up time)?

There is a Python (Flask + Celery mysql, redis) project.
Tasks are set for celery, which must be completed according to the schedule.
It is necessary to check that after N hours, or at the moment of time transition (or other problems and situations that may arise) are processed correctly.
Waiting a day/week/year for this is naturally not an option.
Changing the time in docker is not available.
How to solve this problem? (correct or fast)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
Eugene, 2017-02-01
@zolt85

Do you want to test Cron? That he will start at exactly the right time? Or do you still want to test the operation of a scheduled task?
Cron, I think, does not need testing. But the task can be covered with tests. And don't do magic.

A
Alexey, 2017-01-31
@alcyone

Make a trigger for every 5 minutes and check that the job is working, then change the scheduling to the correct one.

V
Vlad, 2017-01-31
@d1skort

Google it: celery task monitoring, Flower

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question