databio / bedboss

Python pipeline for processing BED files for BEDbase
https://docs.bedbase.org
BSD 2-Clause "Simplified" License
1 stars 0 forks source link

All pytest currently errors with: OSError: [Errno 29] Illegal seek #30

Closed donaldcampbelljr closed 6 months ago

donaldcampbelljr commented 7 months ago

All tests on dev branch fail with this error:

Traceback (most recent call last):
  File "/home/drc/GITHUB/bedboss/bedboss/venv/bin/pytest", line 8, in <module>
    sys.exit(console_main())
  File "/home/drc/GITHUB/bedboss/bedboss/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 197, in console_main
    code = main()
  File "/home/drc/GITHUB/bedboss/bedboss/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 174, in main
    ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
  File "/home/drc/GITHUB/bedboss/bedboss/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 501, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  File "/home/drc/GITHUB/bedboss/bedboss/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 119, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/home/drc/GITHUB/bedboss/bedboss/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 138, in _multicall
    raise exception.with_traceback(exception.__traceback__)
  File "/home/drc/GITHUB/bedboss/bedboss/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 102, in _multicall
    res = hook_impl.function(*args)
  File "/home/drc/GITHUB/bedboss/bedboss/venv/lib/python3.10/site-packages/_pytest/main.py", line 319, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "/home/drc/GITHUB/bedboss/bedboss/venv/lib/python3.10/site-packages/_pytest/main.py", line 314, in wrap_session
    config._ensure_unconfigure()
  File "/home/drc/GITHUB/bedboss/bedboss/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1081, in _ensure_unconfigure
    fin()
  File "/home/drc/GITHUB/bedboss/bedboss/venv/lib/python3.10/site-packages/_pytest/capture.py", line 758, in stop_global_capturing
    self._global_capturing.pop_outerr_to_orig()
  File "/home/drc/GITHUB/bedboss/bedboss/venv/lib/python3.10/site-packages/_pytest/capture.py", line 640, in pop_outerr_to_orig
    out, err = self.readouterr()
  File "/home/drc/GITHUB/bedboss/bedboss/venv/lib/python3.10/site-packages/_pytest/capture.py", line 687, in readouterr
    out = self.out.snap() if self.out else ""
  File "/home/drc/GITHUB/bedboss/bedboss/venv/lib/python3.10/site-packages/_pytest/capture.py", line 570, in snap
    self.tmpfile.seek(0)
OSError: [Errno 29] Illegal seek

This might be related to these issues: https://github.com/huggingface/transformers/pull/5835 https://github.com/wandb/wandb/issues/1138

A guess:

khoroshevskyi commented 7 months ago

After investigating that issue more deeply, me and @donaldcampbelljr found, that the actual issue is in pypiper.

While running simplest opening and closing pypiper, after running tests this issue is raised.

donaldcampbelljr commented 7 months ago

Reproduce by setting the multi flag to false or just leaving it out:

def test_temp_test():
    pp = pypiper.PipelineManager(
        "sample_pipeline", outfolder="/home/drc/Downloads/BED_CLASSIFIER_OUTPUT/", multi=True
    )

If you set the flag multi=True, it works fine and we no longer get the illegal seek error.