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 #388DescriptionThere 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 Activitytlambert03 commented on Dec 4, 2023 ContributorAuthor More actions i think this might have to do with the png files themselves being git-lfs stubs. kushalkolar commented on Dec 4, 2023 What if you do git lfs pull? tlambert03 commented on Dec 4, 2023 ContributorAuthor More actions yep, I'm updating the readme now in another pr kushalkolar commented on Dec 4, 2023 tlambert03 commented 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? kushalkolar commented on Dec 6, 2023 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. tlambert03 commented 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 kushalkolar commented on Dec 6, 2023 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
…tlambert03 commented 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 kushalkolar commented on Dec 7, 2023 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. tlambert03 commented 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 :)
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|