Skip to content

Commit

Permalink
Increase Kedro Viz timeout (#1803)
Browse files Browse the repository at this point in the history
* increase viz timeout

Signed-off-by: ravi-kumar-pilla <[email protected]>

* fix lint and add release note

Signed-off-by: ravi-kumar-pilla <[email protected]>

* test comment to check unit test

Signed-off-by: ravi-kumar-pilla <[email protected]>

* test comment to check unit test

Signed-off-by: ravi-kumar-pilla <[email protected]>

* reduce mock timeout

Signed-off-by: ravi-kumar-pilla <[email protected]>

---------

Signed-off-by: ravi-kumar-pilla <[email protected]>
  • Loading branch information
ravi-kumar-pilla authored Mar 19, 2024
1 parent 6173dc2 commit ec3540e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
6 changes: 6 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ Please follow the established format:
- Use present tense (e.g. 'Add new feature')
- Include the ID number for the related PR (or PRs) in parentheses
-->
# Upcoming Release

## Bug fixes and other changes

- Increase Kedro-Viz timeout. (#1803)

# Release 8.0.1

## Bug fixes and other changes
Expand Down
3 changes: 2 additions & 1 deletion package/kedro_viz/launchers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class WaitForException(Exception):
def _wait_for(
func: Callable,
expected_result: Any = True,
timeout: int = 60,
# [TODO] This is a temporary fix for https://github.com/kedro-org/kedro-viz/issues/1768.
timeout: int = 600,
print_error: bool = True,
sleep_for: int = 1,
**kwargs,
Expand Down
12 changes: 10 additions & 2 deletions package/tests/test_launchers/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def test_kedro_viz_command_run_server(
):
process_init = mocker.patch("multiprocessing.Process")
runner = CliRunner()

# Reduce the timeout argument from 600 to 1 to make test run faster.
mocker.patch("kedro_viz.launchers.cli._wait_for.__defaults__", (True, 1, True, 1))

with runner.isolated_filesystem():
Expand All @@ -200,7 +200,11 @@ def test_kedro_viz_command_should_log_outdated_version(
data={"info": {"version": mock_version}}
)

# test push
mocker.patch("kedro_viz.server.run_server")

# Reduce the timeout argument from 600 to 1 to make test run faster.
mocker.patch("kedro_viz.launchers.cli._wait_for.__defaults__", (True, 1, True, 1))
runner = CliRunner()
with runner.isolated_filesystem():
runner.invoke(cli.viz_cli, ["viz", "run"])
Expand Down Expand Up @@ -228,6 +232,8 @@ def test_kedro_viz_command_should_not_log_latest_version(
)

mocker.patch("kedro_viz.server.run_server")
# Reduce the timeout argument from 600 to 1 to make test run faster.
mocker.patch("kedro_viz.launchers.cli._wait_for.__defaults__", (True, 1, True, 1))
runner = CliRunner()
with runner.isolated_filesystem():
runner.invoke(cli.viz_cli, ["viz", "run"])
Expand All @@ -244,6 +250,8 @@ def test_kedro_viz_command_should_not_log_if_pypi_is_down(
requests_get.side_effect = requests.exceptions.RequestException("PyPI is down")

mocker.patch("kedro_viz.server.run_server")
# Reduce the timeout argument from 600 to 1 to make test run faster.
mocker.patch("kedro_viz.launchers.cli._wait_for.__defaults__", (True, 1, True, 1))
runner = CliRunner()
with runner.isolated_filesystem():
runner.invoke(cli.viz_cli, ["viz", "run"])
Expand All @@ -258,7 +266,7 @@ def test_kedro_viz_command_with_autoreload(
):
process_init = mocker.patch("multiprocessing.Process")

# Reduce the timeout argument from 60 to 1 to make test run faster.
# Reduce the timeout argument from 600 to 1 to make test run faster.
mocker.patch("kedro_viz.launchers.cli._wait_for.__defaults__", (True, 1, True, 1))
runner = CliRunner()
with runner.isolated_filesystem():
Expand Down

0 comments on commit ec3540e

Please sign in to comment.