Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Commit

Permalink
Simplify hanging queue test (Lightning-AI#10591)
Browse files Browse the repository at this point in the history
  • Loading branch information
carmocca authored and Raalsky committed Nov 23, 2021
1 parent d70d264 commit 1a45e36
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_test-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
# this will install stable torch
python-version: [3.9]

# Timeout: https://stackoverflow.com/a/59076067/4521646
# lower timeout as this should run very quickly
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci_test-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
python-version: ["3.8"] # previous to last Python version as that one is already used in test-full
pytorch-version: ["1.7", "1.8", "1.9", "1.10"] # nightly: add when there's a release candidate

# Timeout: https://stackoverflow.com/a/59076067/4521646
timeout-minutes: 35
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/ci_test-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ jobs:
# nightly: add when there's a release candidate
#- {os: ubuntu-20.04, python-version: "3.10", requires: "latest", release: "pre"}

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

steps:
Expand Down
17 changes: 5 additions & 12 deletions tests/deprecated_api/test_remove_1-7.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from unittest import mock

import pytest
import torch

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


class BoringCallbackDDPSpawnModel(BoringModel):
def __init__(self):
super().__init__()
def add_to_queue(self, queue):
...

def add_to_queue(self, queue: torch.multiprocessing.SimpleQueue) -> None:
queue.put("test_val")
return super().add_to_queue(queue)
def get_from_queue(self, queue):
...

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


@RunIf(skip_windows=True, skip_49370=True)
def test_v1_7_0_deprecate_add_get_queue(tmpdir):
model = BoringCallbackDDPSpawnModel()
trainer = Trainer(default_root_dir=tmpdir, fast_dev_run=True, num_processes=2, strategy="ddp_spawn")
trainer = Trainer(default_root_dir=tmpdir, fast_dev_run=True)

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

0 comments on commit 1a45e36

Please sign in to comment.