Skip to content

TST: non-deterministic ResourceWarnings seen in Python 3.13 and 3.14 in CI with remote data #19511

Closed

Description

@neutrinoceros

I'm seeing non deterministic warnings in the following PRs, which are both attempts to bump some Python version used in CI

I think a possible solution would be reverting #17282
edit: nevermind, the warnings I'm seeing are slightly different

Activity

  1. pllim commented on Apr 6, 2026

    @pllim
    Member

    Next time you see them, can you please post the exact traceback (without the ignore)? Thanks!

  2. added and removed
    Affects-devPRs and issues that do not impact an existing Astropy release
    on Apr 6, 2026
  3. pllim commented on Apr 28, 2026

    @pllim
    Member

    @neutrinoceros , is this the one you are seeing? I saw it in one of my PRs.

    _____________________ TestSimplifyBasicIndex.test_indexing _____________________
      + Exception Group Traceback (most recent call last):
      |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/_pytest/runner.py", line 353, in from_call
      |     result: TResult | None = func()
      |                              ~~~~^^
      |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/_pytest/runner.py", line 245, in <lambda>
      |     lambda: runtest_hook(item=item, **kwds),
      |             ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
      |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/pluggy/_hooks.py", line 512, in __call__
      |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
      |            ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/pluggy/_manager.py", line 120, in _hookexec
      |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
      |            ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/pluggy/_callers.py", line 167, in _multicall
      |     raise exception
      |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/pluggy/_callers.py", line 139, in _multicall
      |     teardown.throw(exception)
      |     ~~~~~~~~~~~~~~^^^^^^^^^^^
      |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/_pytest/logging.py", line 850, in pytest_runtest_call
      |     yield
      |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/pluggy/_callers.py", line 139, in _multicall
      |     teardown.throw(exception)
      |     ~~~~~~~~~~~~~~^^^^^^^^^^^
      |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/pluggy/_callers.py", line 53, in run_old_style_hookwrapper
      |     return result.get_result()
      |            ~~~~~~~~~~~~~~~~~^^
      |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/pluggy/_result.py", line 103, in get_result
      |     raise exc.with_traceback(tb)
      |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/pluggy/_callers.py", line 38, in run_old_style_hookwrapper
      |     res = yield
      |           ^^^^^
      |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/pluggy/_callers.py", line 139, in _multicall
      |     teardown.throw(exception)
      |     ~~~~~~~~~~~~~~^^^^^^^^^^^
      |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/_pytest/capture.py", line 900, in pytest_runtest_call
      |     return (yield)
      |             ^^^^^
      |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/pluggy/_callers.py", line 139, in _multicall
      |     teardown.throw(exception)
      |     ~~~~~~~~~~~~~~^^^^^^^^^^^
      |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/pluggy/_callers.py", line 53, in run_old_style_hookwrapper
      |     return result.get_result()
      |            ~~~~~~~~~~~~~~~~~^^
      |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/pluggy/_result.py", line 103, in get_result
      |     raise exc.with_traceback(tb)
      |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/pluggy/_callers.py", line 38, in run_old_style_hookwrapper
      |     res = yield
      |           ^^^^^
      |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/pluggy/_callers.py", line 139, in _multicall
      |     teardown.throw(exception)
      |     ~~~~~~~~~~~~~~^^^^^^^^^^^
      |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/_pytest/skipping.py", line 268, in pytest_runtest_call
      |     return (yield)
      |             ^^^^^
      |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/pluggy/_callers.py", line 121, in _multicall
      |     res = hook_impl.function(*args)
      |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/_pytest/unraisableexception.py", line 158, in pytest_runtest_call
      |     collect_unraisable(item.config)
      |     ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
      |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/_pytest/unraisableexception.py", line 81, in collect_unraisable
      |     raise ExceptionGroup("multiple unraisable exception warnings", errors)
      | ExceptionGroup: multiple unraisable exception warnings (2 sub-exceptions)
      +-+---------------- 1 ----------------
        | Traceback (most recent call last):
        |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/hypothesis/strategies/_internal/strategies.py", line 117, in forced_value
        |     return getattr(target, cache_key)
        | ResourceWarning: unclosed <ssl.SSLSocket [closed] fd=18, family=2, type=1, proto=6>
        | 
        | The above exception was the direct cause of the following exception:
        | 
        | Traceback (most recent call last):
        |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/_pytest/unraisableexception.py", line 67, in collect_unraisable
        |     warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
        |     ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        | pytest.PytestUnraisableExceptionWarning: Exception ignored while finalizing socket <ssl.SSLSocket [closed] fd=18, family=2, type=1, proto=6>: None
        | 
        +---------------- 2 ----------------
        | Traceback (most recent call last):
        |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/hypothesis/strategies/_internal/strategies.py", line 115, in forced_value
        |     return getattr(target, force_key)
        | AttributeError: 'LazyStrategy' object has no attribute 'force_is_empty'. Did you mean: 'calc_is_empty'?
        | 
        | During handling of the above exception, another exception occurred:
        | 
        | Traceback (most recent call last):
        |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/hypothesis/strategies/_internal/strategies.py", line 117, in forced_value
        |     return getattr(target, cache_key)
        | ResourceWarning: unclosed <ssl.SSLSocket [closed] fd=13, family=2, type=1, proto=6>
        | 
        | The above exception was the direct cause of the following exception:
        | 
        | Traceback (most recent call last):
        |   File "/home/runner/work/astropy/astropy/.tox/py314-test-devdeps/lib/python3.14/site-packages/_pytest/unraisableexception.py", line 67, in collect_unraisable
        |     warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
        |     ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        | pytest.PytestUnraisableExceptionWarning: Exception ignored while finalizing socket <ssl.SSLSocket [closed] fd=13, family=2, type=1, proto=6>: None
        | 
        +------------------------------------
    =========================== short test summary info ============================
    FAILED astropy/utils/tests/test_shapes.py::TestSimplifyBasicIndex::test_indexing - ExceptionGroup: multiple unraisable exception warnings (2 sub-exceptions)
    
  4. neutrinoceros commented on Apr 28, 2026

    @neutrinoceros
    ContributorAuthor

    Yes. Although the exact point of failure is not reproducible, so the traceback is essentially useless. I think the warning is emitted at a random point, probably on a gc collection cycle.

  5. pllim commented on Apr 29, 2026

    @pllim
    Member

    Rather than jump down the rabbit hole, I opted the easy way out... please see #19610

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions