Skip to content

Commit c15b84d

Browse files
authored
Simplify hanging queue test (#10591)
1 parent ff3443f commit c15b84d

File tree

4 files changed

+6
-16
lines changed

4 files changed

+6
-16
lines changed

.github/workflows/ci_test-base.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
# this will install stable torch
2020
python-version: [3.9]
2121

22-
# Timeout: https://stackoverflow.com/a/59076067/4521646
22+
# lower timeout as this should run very quickly
2323
timeout-minutes: 20
2424
steps:
2525
- uses: actions/checkout@v2

.github/workflows/ci_test-conda.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ jobs:
1717
python-version: ["3.8"] # previous to last Python version as that one is already used in test-full
1818
pytorch-version: ["1.7", "1.8", "1.9", "1.10"] # nightly: add when there's a release candidate
1919

20-
# Timeout: https://stackoverflow.com/a/59076067/4521646
2120
timeout-minutes: 35
2221
steps:
2322
- uses: actions/checkout@v2

.github/workflows/ci_test-full.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ jobs:
2929
# nightly: add when there's a release candidate
3030
#- {os: ubuntu-20.04, python-version: "3.10", requires: "latest", release: "pre"}
3131

32-
# Timeout: https://stackoverflow.com/a/59076067/4521646
33-
# TODO: the macOS is taking too long, probably caching did not work...
3432
timeout-minutes: 40
3533

3634
steps:

tests/deprecated_api/test_remove_1-7.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from unittest import mock
1616

1717
import pytest
18-
import torch
1918

2019
from pytorch_lightning import Callback, LightningDataModule, Trainer
2120
from pytorch_lightning.callbacks.gpu_stats_monitor import GPUStatsMonitor
@@ -233,22 +232,16 @@ def test_v1_7_0_flush_logs_every_n_steps_trainer_constructor(tmpdir):
233232

234233

235234
class BoringCallbackDDPSpawnModel(BoringModel):
236-
def __init__(self):
237-
super().__init__()
235+
def add_to_queue(self, queue):
236+
...
238237

239-
def add_to_queue(self, queue: torch.multiprocessing.SimpleQueue) -> None:
240-
queue.put("test_val")
241-
return super().add_to_queue(queue)
238+
def get_from_queue(self, queue):
239+
...
242240

243-
def get_from_queue(self, queue: torch.multiprocessing.SimpleQueue) -> None:
244-
self.test_val = queue.get()
245-
return super().get_from_queue(queue)
246241

247-
248-
@RunIf(skip_windows=True, skip_49370=True)
249242
def test_v1_7_0_deprecate_add_get_queue(tmpdir):
250243
model = BoringCallbackDDPSpawnModel()
251-
trainer = Trainer(default_root_dir=tmpdir, fast_dev_run=True, num_processes=2, strategy="ddp_spawn")
244+
trainer = Trainer(default_root_dir=tmpdir, fast_dev_run=True)
252245

253246
with pytest.deprecated_call(match=r"`LightningModule.add_to_queue` method was deprecated in v1.5"):
254247
trainer.fit(model)

0 commit comments

Comments
 (0)