Skip to content

Commit

Permalink
Increase post launch redirect timeout
Browse files Browse the repository at this point in the history
This will help with slow target configurations
  • Loading branch information
tysmith committed Jun 28, 2024
1 parent 90584bc commit c84f924
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions grizzly/common/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
__credits__ = ["Tyson Smith"]

LOG = getLogger(__name__)
# time in seconds to wait for target to navigate away from post launch page
POST_LAUNCH_TIMEOUT = 600
# display warning if launch duration exceeds set value
SLOW_LAUNCH_THRESHOLD = 20

Expand Down Expand Up @@ -253,7 +255,7 @@ def post_launch(self, delay: int = 0) -> None:
"""Perform actions after launching browser before loading test cases.
Args:
post_launch_delay: Time in seconds before the target will continue.
delay: Time in seconds before the target will continue.
Returns:
None
Expand All @@ -272,10 +274,11 @@ def post_launch(self, delay: int = 0) -> None:
org_timeout = self._server.timeout
# add time buffer to redirect delay
# in practice this should take a few seconds (~10s)
# in extreme cases ~40s (slow build + debugger)
self._server.timeout = delay + 180
# in extreme cases ~180s (slow build + debugger + other settings)
self._server.timeout = delay + POST_LAUNCH_TIMEOUT
if delay > 0:
LOG.info("Browser launched, continuing in %ds...", delay)
LOG.debug("post launch timeout: %ds", self._server.timeout)
# serve prompt page
server_status, _ = self._server.serve_path(
content.root,
Expand Down

0 comments on commit c84f924

Please sign in to comment.