https://prefect.io logo
Title
l

Lana Dann

02/15/2022, 8:18 PM
hi! i have a question on testing flows. if i have a flow that’s scheduled to run once a week, am i able to still run it locally using
flow.run()
? i’m trying to create an integration test now and it’s just stalling so i wonder if it’s because the schedule that’s attached to it is waiting until the actual start time.
a

Anna Geller

02/15/2022, 8:20 PM
Yes, that's correct. You would need to comment out the schedule element of the Flow object to run it immediately ad hoc, or trigger it via UI Quick Run
k

Kevin Kho

02/15/2022, 8:20 PM
You can do
flow.run(run_on_schedule=False)
, but running with a backend is preferred
:upvote: 1
l

Lana Dann

02/15/2022, 8:26 PM
got it. so i have a task that usually runs on a schedule and uses the ECSTaskExecutor. to run it locally in my integration test, i’d need to set
run_on_schedule=False
and then what do i set for
runner_cls
? i tried to pass in
LocalExecutor
and it didn’t work
k

Kevin Kho

02/15/2022, 8:27 PM
Do you mean the ECS RunConfig? Because
flow.run()
does respect RunConfig. Only Flows run from Prefect Cloud do
l

Lana Dann

02/15/2022, 8:28 PM
ohhh yes got it i was confused. i left that runner_cls parameter empty and it seemed the test worked. thanks!
k

Kevin Kho

02/15/2022, 8:28 PM
Yeah that should work.