Skip to content

Commit 654750e

Browse files
committed
Simplify hanging queue test (#10591)
1 parent 7282ed4 commit 654750e

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
@@ -20,7 +20,7 @@ jobs:
2020
# this will install stable torch
2121
python-version: [3.9]
2222

23-
# Timeout: https://stackoverflow.com/a/59076067/4521646
23+
# lower timeout as this should run very quickly
2424
timeout-minutes: 20
2525
steps:
2626
- 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.6", "1.7", "1.8", "1.9", "1.10"]
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
@@ -34,8 +34,6 @@ jobs:
3434
- {os: windows-2019, python-version: "3.9", requires: "oldest", release: "stable"}
3535
- {os: macOS-10.15, python-version: "3.9", requires: "oldest", release: "stable"}
3636

37-
# Timeout: https://stackoverflow.com/a/59076067/4521646
38-
# TODO: the macOS is taking too long, probably caching did not work...
3937
timeout-minutes: 40
4038

4139
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
@@ -230,22 +229,16 @@ def test_v1_7_0_flush_logs_every_n_steps_trainer_constructor(tmpdir):
230229

231230

232231
class BoringCallbackDDPSpawnModel(BoringModel):
233-
def __init__(self):
234-
super().__init__()
232+
def add_to_queue(self, queue):
233+
...
235234

236-
def add_to_queue(self, queue: torch.multiprocessing.SimpleQueue) -> None:
237-
queue.put("test_val")
238-
return super().add_to_queue(queue)
235+
def get_from_queue(self, queue):
236+
...
239237

240-
def get_from_queue(self, queue: torch.multiprocessing.SimpleQueue) -> None:
241-
self.test_val = queue.get()
242-
return super().get_from_queue(queue)
243238

244-
245-
@RunIf(skip_windows=True, skip_49370=True)
246239
def test_v1_7_0_deprecate_add_get_queue(tmpdir):
247240
model = BoringCallbackDDPSpawnModel()
248-
trainer = Trainer(default_root_dir=tmpdir, fast_dev_run=True, num_processes=2, strategy="ddp_spawn")
241+
trainer = Trainer(default_root_dir=tmpdir, fast_dev_run=True)
249242

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

0 commit comments

Comments
 (0)