Skip to content

Commit ed28475

Browse files
committed
Test fixes
Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com>
1 parent 8ffacc8 commit ed28475

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

.github/workflows/cicd_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ env:
3737
PYTORCH_VER2: '2.9.1'
3838
PYTORCH_VER3: '2.10.0'
3939
PYTORCH_VER4: '2.11.0'
40-
TORCHVISION_VER: '0.23.0' # used for testing with lowest PyTorch version
40+
TORCHVISION_VER: '0.23.0' # used for testing with lowest PyTorch version (PYTORCH_VER1), update as needed
4141
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION: python # https://github.com/Project-MONAI/MONAI/issues/4354
4242

4343
# These jobs run the CICD tests, type checking, and testing packaging. These use the minimum supported versions of
@@ -98,7 +98,7 @@ jobs:
9898
pytorch-version: '2.8.0'
9999
python-version: '3.13'
100100
- os: ubuntu-latest
101-
pytorch-version: '2.9.0'
101+
pytorch-version: '2.9.1'
102102
python-version: '3.14'
103103

104104
# Test PyTorch versions under Ubuntu with lowest Python version supported

tests/test_utils.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ def run_process(self, func, local_rank, args, kwargs, results):
533533
time.sleep(0.1)
534534
results.put(True)
535535
except Exception as e:
536-
results.put(False)
536+
results.put(str(e))
537537
raise e
538538
finally:
539539
os.environ.clear()
@@ -562,15 +562,17 @@ def _wrapper(*args, **kwargs):
562562
results = tmp.Queue()
563563
func = _call_original_func
564564
args = [obj.__name__, obj.__module__] + list(args)
565+
565566
for proc_rank in range(self.nproc_per_node):
566-
p = tmp.Process(
567-
target=self.run_process, args=(func, proc_rank, args, kwargs, results), daemon=self.daemon
568-
)
567+
run_args = (func, proc_rank, args, kwargs, results)
568+
p = tmp.Process(target=self.run_process, args=run_args, daemon=self.daemon)
569569
p.start()
570570
processes.append(p)
571+
571572
for p in processes:
572573
p.join()
573-
assert results.get(), "Distributed call failed."
574+
pr=results.get()
575+
assert pr is True, f"Distributed call failed: {pr}"
574576
_del_original_func(obj)
575577

576578
return _wrapper

0 commit comments

Comments
 (0)