[test] refactored with the new rerun decorator (#763)

* [test] refactored with the new rerun decorator

* polish test case
This commit is contained in:
Frank Lee
2022-04-15 00:33:04 +08:00
committed by GitHub
parent deaf99f4c9
commit 5a1a095b92
34 changed files with 80 additions and 75 deletions

View File

@@ -17,7 +17,7 @@ from torchvision import transforms
from colossalai.context import ParallelMode, Config
from colossalai.core import global_context as gpc
from colossalai.utils import get_dataloader, free_port
from colossalai.testing import rerun_on_exception
from colossalai.testing import rerun_if_address_is_in_use
CONFIG = Config(
dict(
@@ -67,7 +67,7 @@ def run_data_sampler(rank, world_size, port):
@pytest.mark.cpu
@rerun_on_exception(exception_type=mp.ProcessRaisedException, pattern=".*Address already in use.*")
@rerun_if_address_is_in_use()
def test_data_sampler():
world_size = 4
test_func = partial(run_data_sampler, world_size=world_size, port=free_port())