Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_signal_handlers_restored_in_teardown failing on mac and linux #11633

Closed
akihironitta opened this issue Jan 26, 2022 · 2 comments 路 Fixed by #11635
Closed

test_signal_handlers_restored_in_teardown failing on mac and linux #11633

akihironitta opened this issue Jan 26, 2022 · 2 comments 路 Fixed by #11635
Assignees
Labels
bug Something isn't working ci Continuous Integration priority: 0 High priority task

Comments

@akihironitta
Copy link
Contributor

akihironitta commented Jan 26, 2022

馃悰 Bug

In all ongoing PRs,test_signal_handlers_restored_in_teardown fails, and a few test cases after, the job is terminated.

tests/trainer/connectors/test_signal_connector.py::test_signal_handlers_restored_in_teardown FAILED [ 79%]
tests/trainer/connectors/test_signal_connector.py::test_fault_tolerant_sig_handler[False-False] PASSED [ 79%]
tests/trainer/connectors/test_signal_connector.py::test_fault_tolerant_sig_handler[False-True] PASSED [ 79%]
Terminated
tests/trainer/connectors/test_signal_connector.py::test_fault_tolerant_sig_handler[True-False] 
Error: Process completed with exit code 143.

To Reproduce

https://github.com/PyTorchLightning/pytorch-lightning/actions/runs/1751182495

Expected behavior

  • No test failure of the test case above.
  • No termination of CI jobs

Additional context

cc @tchaton @rohitgr7 @akihironitta @carmocca @Borda

@akihironitta akihironitta added bug Something isn't working priority: 0 High priority task ci Continuous Integration labels Jan 26, 2022
@akihironitta akihironitta self-assigned this Jan 26, 2022
@akihironitta akihironitta mentioned this issue Jan 26, 2022
9 tasks
@akihironitta
Copy link
Contributor Author

Here's the minimal reproducible command and its error msg:

$ coverage --version
Coverage.py, version 6.3 with C extension
Full documentation is at https://coverage.readthedocs.io
$ coverage run -m pytest tests/trainer/connectors/test_signal_connector.py::test_signal_handlers_restored_in_teardown -vv
=============================================================== test session starts ===============================================================
platform linux -- Python 3.9.6, pytest-6.2.5, py-1.10.0, pluggy-1.0.0 -- /home/nitta/.pyenv/versions/miniconda3-latest/envs/dev-pl39/bin/python
cachedir: .pytest_cache
rootdir: /home/nitta/work/github.com/PyTorchLightning/pytorch-lightning, configfile: setup.cfg
plugins: rerunfailures-10.2, hydra-core-1.1.1
collected 1 item                                                                                                                                  

tests/trainer/connectors/test_signal_connector.py::test_signal_handlers_restored_in_teardown FAILED                                         [100%]

==================================================================== FAILURES =====================================================================
____________________________________________________ test_signal_handlers_restored_in_teardown ____________________________________________________

    @RunIf(skip_windows=True)
    @mock.patch.dict(os.environ, {"PL_FAULT_TOLERANT_TRAINING": "1"})
    def test_signal_handlers_restored_in_teardown():
        """Test that the SignalConnector restores the previously configured handler on teardown."""
>       assert signal.getsignal(signal.SIGTERM) is signal.SIG_DFL
E       assert <bound method Coverage._on_sigterm of <coverage.control.Coverage object at 0x7f75a9ee05b0>> is <Handlers.SIG_DFL: 0>
E        +  where <bound method Coverage._on_sigterm of <coverage.control.Coverage object at 0x7f75a9ee05b0>> = <function getsignal at 0x7f75a9d98820>(<Signals.SIGTERM: 15>)
E        +    where <function getsignal at 0x7f75a9d98820> = signal.getsignal
E        +    and   <Signals.SIGTERM: 15> = signal.SIGTERM
E        +  and   <Handlers.SIG_DFL: 0> = signal.SIG_DFL

tests/trainer/connectors/test_signal_connector.py:34: AssertionError
============================================================= short test summary info =============================================================
FAILED tests/trainer/connectors/test_signal_connector.py::test_signal_handlers_restored_in_teardown - assert <bound method Coverage._on_sigterm ...
========================================================== 1 failed, 4 warnings in 0.53s ==========================================================

@akihironitta
Copy link
Contributor Author

akihironitta commented Jan 26, 2022

This error comes from coverage==6.3 and could probably be related to

I'll look into it, but for now, let's use the previous version coverage<6.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ci Continuous Integration priority: 0 High priority task
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant