Skip to content

Commit

Permalink
FIX more debug for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tomMoral committed Feb 8, 2021
1 parent 03c4e71 commit 70407e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions tests/_test_process_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import faulthandler
from math import sqrt
from threading import Thread
import multiprocessing as mp
from collections import defaultdict

from loky import get_worker_rank
Expand Down Expand Up @@ -1041,9 +1042,10 @@ def test_child_env_executor(self):

@staticmethod
def _worker_rank(x):
time.sleep(.1)
time.sleep(.2)
rank, world = get_worker_rank()
return dict(pid=os.getpid(), rank=rank, world=world)
return dict(pid=os.getpid(), name=mp.current_process().name,
rank=rank, world=world)

@pytest.mark.parametrize('max_workers', [1, 5, 13])
@pytest.mark.parametrize('timeout', [None, 0.01])
Expand Down
6 changes: 4 additions & 2 deletions tests/test_reusable_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import warnings
import threading
from time import sleep
import multiprocessing as mp
from multiprocessing import util, current_process
from pickle import PicklingError, UnpicklingError
from distutils.version import LooseVersion
Expand Down Expand Up @@ -581,9 +582,10 @@ def test_resize_after_timeout(self):

@staticmethod
def _worker_rank(x):
time.sleep(.1)
time.sleep(.2)
rank, world = get_worker_rank()
return dict(pid=os.getpid(), rank=rank, world=world)
return dict(pid=os.getpid(), name=mp.current_process().name,
rank=rank, world=world)

@pytest.mark.parametrize('timeout', [10, 0.01])
def test_workers_rank_resize(self, timeout):
Expand Down

0 comments on commit 70407e9

Please sign in to comment.