Skip to content

Commit

Permalink
Add test timeouts (#3241)
Browse files Browse the repository at this point in the history
* add timeout to distributed tests

* add pytest-timeout as dep

* alter timeout in distributed config group
  • Loading branch information
leej3 authored Apr 24, 2024
1 parent f431e60 commit 95c0154
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ numpy
pytest
pytest-cov
pytest-xdist
pytest-timeout
dill
setuptools
# Test contrib dependencies
Expand Down
4 changes: 2 additions & 2 deletions tests/ignite/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def distributed_context_single_node_gloo(local_rank, world_size):
"world_size": world_size,
"rank": local_rank,
"init_method": init_method,
"timeout": timedelta(seconds=60),
"timeout": timedelta(seconds=30),
}
yield _create_dist_context(dist_info, local_rank)
_destroy_dist_context()
Expand Down Expand Up @@ -423,7 +423,7 @@ def distributed(request, local_rank, world_size):
dist_info["backend"] = "gloo"
from datetime import timedelta

dist_info["timeout"] = timedelta(seconds=60)
dist_info["timeout"] = timedelta(seconds=30)
yield _create_dist_context(dist_info, local_rank)
_destroy_dist_context()
if temp_file:
Expand Down
2 changes: 2 additions & 0 deletions tests/ignite/distributed/comp_models/test_native.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
else:
from ignite.distributed.comp_models.native import _expand_hostlist, _NativeDistModel, _setup_ddp_vars_from_slurm_env

pytestmark = pytest.mark.timeout(60)


# tests from https://github.com/LLNL/py-hostlist/blob/master/hostlist/unittest_hostlist.py
@pytest.mark.parametrize(
Expand Down
2 changes: 2 additions & 0 deletions tests/ignite/distributed/test_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import ignite.distributed as idist
from ignite.distributed.utils import has_hvd_support, has_native_dist_support, has_xla_support

pytestmark = pytest.mark.timeout(60)


def test_parallel_wrong_inputs():
with pytest.raises(ValueError, match=r"Unknown backend 'abc'. Available backends:"):
Expand Down

0 comments on commit 95c0154

Please # to comment.