Repository: PrefectHQ/prefect

Issue:
Increase default timeout for pause_flow_run and suspend_flow_run
The current default timeouts for `pause_flow_run()` and `suspend_flow_run()` are five minutes, which is much too short. In fact, why time out at all by default? Let's either lengthen the default timeout or remove it.

**Note:** I don't think expiration processor can cope with None `pause_timeout` values at the moment, if we go that route.


Discussion:

Resolving patch:
diff --git a/src/prefect/engine.py b/src/prefect/engine.py
--- a/src/prefect/engine.py
+++ b/src/prefect/engine.py
@@ -952,7 +952,7 @@ async def orchestrate_flow_run(
 async def pause_flow_run(
     wait_for_input: None = None,
     flow_run_id: UUID = None,
-    timeout: int = 300,
+    timeout: int = 3600,
     poll_interval: int = 10,
     reschedule: bool = False,
     key: str = None,
@@ -964,7 +964,7 @@ async def pause_flow_run(
 async def pause_flow_run(
     wait_for_input: Type[T],
     flow_run_id: UUID = None,
-    timeout: int = 300,
+    timeout: int = 3600,
     poll_interval: int = 10,
     reschedule: bool = False,
     key: str = None,
@@ -988,7 +988,7 @@ async def pause_flow_run(
 async def pause_flow_run(
     wait_for_input: Optional[Type[T]] = None,
     flow_run_id: UUID = None,
-    timeout: int = 300,
+    timeout: int = 3600,
     poll_interval: int = 10,
     reschedule: bool = False,
     key: str = None,
@@ -1011,7 +1011,7 @@ async def pause_flow_run(
             have an associated deployment and results need to be configured with the
             `persist_results` option.
         timeout: the number of seconds to wait for the flow to be resumed before
-            failing. Defaults to 5 minutes (300 seconds). If the pause timeout exceeds
+            failing. Defaults to 1 hour (3600 seconds). If the pause timeout exceeds
             any configured flow-level timeout, the flow might fail even after resuming.
         poll_interval: The number of seconds between checking whether the flow has been
             resumed. Defaults to 10 seconds.
@@ -1050,11 +1050,8 @@ async def pause_flow_run(
 
 
 @inject_client
-@experimental_parameter(
-    "wait_for_input", group="flow_run_input", when=lambda y: y is not None
-)
 async def _in_process_pause(
-    timeout: int = 300,
+    timeout: int = 3600,
     poll_interval: int = 10,
     reschedule=False,
     key: str = None,
@@ -1149,7 +1146,7 @@ async def _in_process_pause(
 @inject_client
 async def _out_of_process_pause(
     flow_run_id: UUID,
-    timeout: int = 300,
+    timeout: int = 3600,
     reschedule: bool = True,
     key: str = None,
     client=None,
@@ -1172,7 +1169,7 @@ async def _out_of_process_pause(
 async def suspend_flow_run(
     wait_for_input: None = None,
     flow_run_id: Optional[UUID] = None,
-    timeout: Optional[int] = 300,
+    timeout: Optional[int] = 3600,
     key: Optional[str] = None,
     client: PrefectClient = None,
 ) -> None:
@@ -1183,7 +1180,7 @@ async def suspend_flow_run(
 async def suspend_flow_run(
     wait_for_input: Type[T],
     flow_run_id: Optional[UUID] = None,
-    timeout: Optional[int] = 300,
+    timeout: Optional[int] = 3600,
     key: Optional[str] = None,
     client: PrefectClient = None,
 ) -> T:
@@ -1192,10 +1189,13 @@ async def suspend_flow_run(
 
 @sync_compatible
 @inject_client
+@experimental_parameter(
+    "wait_for_input", group="flow_run_input", when=lambda y: y is not None
+)
 async def suspend_flow_run(
     wait_for_input: Optional[Type[T]] = None,
     flow_run_id: Optional[UUID] = None,
-    timeout: Optional[int] = 300,
+    timeout: Optional[int] = 3600,
     key: Optional[str] = None,
     client: PrefectClient = None,
 ):
@@ -1214,7 +1214,7 @@ async def suspend_flow_run(
             suspend the specified flow run. If not supplied will attempt to
             suspend the current flow run.
         timeout: the number of seconds to wait for the flow to be resumed before
-            failing. Defaults to 5 minutes (300 seconds). If the pause timeout
+            failing. Defaults to 1 hour (3600 seconds). If the pause timeout
             exceeds any configured flow-level timeout, the flow might fail even
             after resuming.
         key: An optional key to prevent calling suspend more than once. This


Test patch:
diff --git a/tests/test_engine.py b/tests/test_engine.py
--- a/tests/test_engine.py
+++ b/tests/test_engine.py
@@ -652,6 +652,12 @@ class FlowInput(RunInput):
 
 
 class TestSuspendFlowRun:
+    @pytest.fixture(autouse=True)
+    def ignore_experimental_warnings(self):
+        with warnings.catch_warnings():
+            warnings.filterwarnings("ignore", category=ExperimentalFeature)
+            yield
+
     async def test_suspended_flow_runs_do_not_block_execution(
         self, prefect_client, deployment, session
     ):