GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Tests: OSError: [Errno 24] Too many open files · Issue #388 · fastplotlib/fastplotlib

Tests: OSError: [Errno 24] Too many open files #388

New issue
Copy link
New issue
Copy link
Closed
#391
Closed
Tests: OSError: [Errno 24] Too many open files#388
#391
Copy link

Description

@tlambert03
tlambert03
opened on Dec 4, 2023
Issue body actions

There appears to be a leaked file handle somewhere in the tests

  • cloned repo
  • pip install -e ".[notebook,docs,tests]"
  • ran pytest examples
OSError: [Errno 24] Too many open files: '/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/pygments/formatters/terminal.py'
Details
module = PosixPath('/Users/talley/dev/forks/fastplotlib/examples/desktop/gridplot/gridplot.py'), force_offscreen = None

Traceback (most recent call last):
  File "/Users/talley/miniforge3/envs/fastplotlib/bin/pytest", line 8, in <module>
    sys.exit(console_main())
             ^^^^^^^^^^^^^^
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/_pytest/config/__init__.py", line 192, in console_main
    code = main()
           ^^^^^^
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/_pytest/config/__init__.py", line 169, in main
    ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/pluggy/_hooks.py", line 493, in __call__
    return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/pluggy/_manager.py", line 115, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/pluggy/_callers.py", line 113, in _multicall
    raise exception.with_traceback(exception.__traceback__)
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/pluggy/_callers.py", line 77, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/_pytest/main.py", line 318, in pytest_cmdline_main
    return wrap_session(config, _main)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/_pytest/main.py", line 306, in wrap_session
    config.hook.pytest_sessionfinish(
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/pluggy/_hooks.py", line 493, in __call__
    return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/pluggy/_manager.py", line 115, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/pluggy/_callers.py", line 130, in _multicall
    teardown[0].send(outcome)
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/_pytest/terminal.py", line 867, in pytest_sessionfinish
    self.config.hook.pytest_terminal_summary(
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/pluggy/_hooks.py", line 493, in __call__
    return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/pluggy/_manager.py", line 115, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/pluggy/_callers.py", line 152, in _multicall
    return outcome.get_result()
           ^^^^^^^^^^^^^^^^^^^^
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/pluggy/_result.py", line 114, in get_result
    raise exc.with_traceback(exc.__traceback__)
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/pluggy/_callers.py", line 62, in _multicall
    next(wrapper_gen)  # first yield
    ^^^^^^^^^^^^^^^^^
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/_pytest/terminal.py", line 882, in pytest_terminal_summary
    self.summary_failures()
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/_pytest/terminal.py", line 1064, in summary_failures
    self._outrep_summary(rep)
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/_pytest/terminal.py", line 1083, in _outrep_summary
    rep.toterminal(self._tw)
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/_pytest/reports.py", line 89, in toterminal
    longrepr_terminal.toterminal(out)
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/_pytest/_code/code.py", line 1072, in toterminal
    element[0].toterminal(tw)
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/_pytest/_code/code.py", line 1102, in toterminal
    entry.toterminal(tw)
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/_pytest/_code/code.py", line 1197, in toterminal
    self._write_entry_lines(tw)
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/_pytest/_code/code.py", line 1179, in _write_entry_lines
    tw._write_source(source_lines, indents)
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/_pytest/_io/terminalwriter.py", line 192, in _write_source
    new_lines = self._highlight(source).splitlines()
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/_pytest/_io/terminalwriter.py", line 203, in _highlight
    from pygments.formatters.terminal import TerminalFormatter
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 936, in exec_module
  File "<frozen importlib._bootstrap_external>", line 1073, in get_code
  File "<frozen importlib._bootstrap_external>", line 1130, in get_data
OSError: [Errno 24] Too many open files: '/Users/talley/miniforge3/envs/fastplotlib/lib/python3.11/site-packages/pygments/formatters/terminal.py'

I'm on macos 14, python 3.11

Activity

  1. tlambert03 commented on Dec 4, 2023

    @tlambert03
    tlambert03
    on Dec 4, 2023
    ContributorAuthor
    More actions

    i think this might have to do with the png files themselves being git-lfs stubs.

  2. kushalkolar commented on Dec 4, 2023

    @kushalkolar
    kushalkolar
    on Dec 4, 2023
    Member
    More actions

    What if you do git lfs pull?

  3. tlambert03 commented on Dec 4, 2023

    @tlambert03
    tlambert03
    on Dec 4, 2023
    ContributorAuthor
    More actions

    yep, I'm updating the readme now in another pr

  4. kushalkolar commented on Dec 4, 2023

    @kushalkolar
    kushalkolar
    on Dec 4, 2023
    Member
    More actions

    It can be added to the contributing guide. However anytime I make a new clone of fastplotlib it automatically fetches the real files from git lfs as well, but in our CI we had to do it explicitly. I wonder if I set some config option somewhere...

    https://github.com/kushalkolar/fastplotlib/blob/main/CONTRIBUTING.md

  5. kushalkolar
    closed this as completedin #391on Dec 5, 2023
  6. tlambert03 commented on Dec 6, 2023

    @tlambert03
    tlambert03
    on Dec 6, 2023
    ContributorAuthor
    More actions

    hey @kushalkolar, related to running tests locally, (kinda tangential to this thread, but don't want to clog your issues with another question)... after having pulled stuff with git-lfs, I'm unable to run tests locally successfully (macos 14, python 3.11.6). here's what fails/succeeds

    examples/tests/test_examples.py::test_example_screenshots[gridplot] FAILED                                      [ 57%]
    examples/tests/test_examples.py::test_example_screenshots[gridplot_non_square] FAILED                           [ 59%]
    examples/tests/test_examples.py::test_example_screenshots[heatmap] FAILED                                       [ 60%]
    examples/tests/test_examples.py::test_example_screenshots[heatmap_cmap] FAILED                                  [ 62%]
    examples/tests/test_examples.py::test_example_screenshots[heatmap_data] FAILED                                  [ 63%]
    examples/tests/test_examples.py::test_example_screenshots[heatmap_vmin_vmax] FAILED                             [ 65%]
    examples/tests/test_examples.py::test_example_screenshots[image_cmap] FAILED                                    [ 67%]
    examples/tests/test_examples.py::test_example_screenshots[image_rgb] FAILED                                     [ 68%]
    examples/tests/test_examples.py::test_example_screenshots[image_rgbvminvmax] FAILED                             [ 70%]
    examples/tests/test_examples.py::test_example_screenshots[image_simple] FAILED                                  [ 72%]
    examples/tests/test_examples.py::test_example_screenshots[image_vminvmax] FAILED                                [ 73%]
    examples/tests/test_examples.py::test_example_screenshots[line] PASSED                                          [ 75%]
    examples/tests/test_examples.py::test_example_screenshots[line_cmap] FAILED                                     [ 77%]
    examples/tests/test_examples.py::test_example_screenshots[line_colorslice] PASSED                               [ 78%]
    examples/tests/test_examples.py::test_example_screenshots[line_dataslice] FAILED                                [ 80%]
    examples/tests/test_examples.py::test_example_screenshots[line_present_scaling] PASSED                          [ 81%]
    examples/tests/test_examples.py::test_example_screenshots[line_collection] FAILED                               [ 83%]
    examples/tests/test_examples.py::test_example_screenshots[line_collection_cmap_values] PASSED                   [ 85%]
    examples/tests/test_examples.py::test_example_screenshots[line_collection_cmap_values_qualitative] PASSED       [ 86%]
    examples/tests/test_examples.py::test_example_screenshots[line_collection_colors] PASSED                        [ 88%]
    examples/tests/test_examples.py::test_example_screenshots[line_stack] FAILED                                    [ 90%]
    examples/tests/test_examples.py::test_example_screenshots[scatter] PASSED                                       [ 91%]
    examples/tests/test_examples.py::test_example_screenshots[scatter_cmap] PASSED                                  [ 93%]
    examples/tests/test_examples.py::test_example_screenshots[scatter_colorslice] FAILED                            [ 95%]
    examples/tests/test_examples.py::test_example_screenshots[scatter_dataslice] PASSED                             [ 96%]
    examples/tests/test_examples.py::test_example_screenshots[scatter_present] FAILED                               [ 98%]
    examples/tests/test_examples.py::test_example_screenshots[scatter_size] FAILED                                  [100%]
    

    I'm just curious: do you run these tests locally in a platform independent way yourself? or do you mostly rely on CI tests?

  7. kushalkolar commented on Dec 6, 2023

    @kushalkolar
    kushalkolar
    on Dec 6, 2023
    Member
    More actions

    It's expected that the tests will fail locally because there are small differences based on the hardware you're running on, we have to rely on GitHub actions for now. In the future we'll look into implementing similarity metric based testing.

  8. tlambert03 commented on Dec 6, 2023

    @tlambert03
    tlambert03
    on Dec 6, 2023
    ContributorAuthor
    More actions

    hmm, ok. yeah that definitely makes it a bit harder to debug fails like i'm getting in #390

  9. kushalkolar commented on Dec 6, 2023

    @kushalkolar
    kushalkolar
    on Dec 6, 2023 via email
    Member
    More actions
    You can download the screenshot diffs by going to the workflow page for that PR and see to get an idea of why it failed :D
    …
    On Wed, Dec 6, 2023, 17:32 Talley Lambert ***@***.***> wrote: hmm, ok. yeah that definitely makes it a bit harder to debug fails like i'm getting in #390 <#390> — Reply to this email directly, view it on GitHub <#388 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACHXXRDGJUU3Q3GHIDC4RQ3YIDW65AVCNFSM6AAAAABAGGSMEOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBTG44TIMBVGY> . You are receiving this because you were mentioned.Message ID: ***@***.***>
  10. tlambert03 commented on Dec 6, 2023

    @tlambert03
    tlambert03
    on Dec 6, 2023
    ContributorAuthor
    More actions

    yep thanks i remember that tip :) will try when I have time to iterate on it that way

  11. kushalkolar commented on Dec 7, 2023

    @kushalkolar
    kushalkolar
    on Dec 7, 2023
    Member
    More actions

    If the PR is inteded to create different screenshots, you can download the screenshots from the Screenshots / Regenerate workflow, visually inspect them, and finally replace the screenshots in your local clone of the repo with the new regenerated ones, and then push.

  12. tlambert03 commented on Dec 8, 2023

    @tlambert03
    tlambert03
    on Dec 8, 2023
    ContributorAuthor
    More actions

    side note on this issue. I do think there is a lingering file handle leakage somewhere, but i think it's upstream of fastplotlib. I wasn't able to make an entirely reproducible example (and it also goes away if you use pytest -s to print to stdout). It's either something low level in pygfx (possibly related to metal). Not worth re-opening this issue until I can make something reproducible :)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.