hi! i have a question on testing flows. if i have ...
# prefect-server
l
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
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
You can do
flow.run(run_on_schedule=False)
, but running with a backend is preferred
upvote 1
l
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
Do you mean the ECS RunConfig? Because
flow.run()
does respect RunConfig. Only Flows run from Prefect Cloud do
l
ohhh yes got it i was confused. i left that runner_cls parameter empty and it seemed the test worked. thanks!
k
Yeah that should work.