loguru
loguru copied to clipboard
One test fails on OpenBSD
Hey,
I'm trying the last release on OpenBSD and one test fails as:
_______________________ test_await_complete_inheritance ________________________
capsys = <_pytest.capture.CaptureFixture object at 0xe81f4b74150>
fork_context = <multiprocessing.context.ForkContext object at 0xe8171cb9110>
> ???
E AssertionError: assert 1 == 0
E + where 1 = <ForkProcess name='ForkProcess-19' pid=33501 parent=73884 stopped exitcode=1>.exitcode
tests/test_multiprocessing.py:439: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG asyncio:selector_events.py:54 Using selector: KqueueSelector
=============================== warnings summary ===============================
tests/test_parse.py::test_greedy_pattern
/usr/local/lib/python3.11/asyncio/base_events.py:679: RuntimeWarning: coroutine 'test_await_complete_inheritance.<locals>.writer' was never awaited
self._ready.clear()
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
Hi @catap.
Thanks for the report.
I tried multiple times to run the tests suite on OpenBSD but got no error. Please, can you give me more information about your environment? Notably, what is the OpenBSD version and the Python patch version you're using?
For reference, I tested with OpenBSD 7.5 and Python 3.10.14.
Hi,
I've used -current on that time which is match 7.6 which should be released soon (the next week?) with python 3.11.10.
I just tested it on my laptop, and I can reproduce the same issue.
loguru is part of OpenBSD ports now (I needed it for mitmproxy if I recall rigth) and an easy way to reproduce the error is run make test inside /usr/ports/devel/py-loguru. You may speedup things py installing all dependencies from a mirror via env FETCH_PACKAGES= make prepare test-depends install-depends. And to get ports you may follow https://www.openbsd.org/faq/ports/ports.html#PortsFetch
Thanks for the prompt answer and instructions, @catap.
Unfortunately, I was unable to find the py-loguru port. It's not in the .tar.gz mirror nor in the CVS web version.
I tried to fetch -current ports tree using the cvs command as well, but without much success.
Since I'm not familiar with OpenBSD, maybe it's just a configuration error on my part. I'll give it another try once the 7.6 is officially released.
Thanks for the prompt answer and instructions, @catap.
Unfortunately, I was unable to find the
py-loguruport. It's not in the.tar.gzmirror nor in the CVS web version. I tried to fetch-currentports tree using thecvscommand as well, but without much success. Since I'm not familiar with OpenBSD, maybe it's just a configuration error on my part. I'll give it another try once the 7.6 is officially released.
Well.. Seems it wasn't yet imported and it means that I made it for update of wapiti. Neverless here the port: py-loguru.tar.gz
You need to unpack it into /usr/ports to have files:
$ find /usr/ports/devel/py-loguru/
/usr/ports/devel/py-loguru/
/usr/ports/devel/py-loguru/pkg
/usr/ports/devel/py-loguru/pkg/PLIST
/usr/ports/devel/py-loguru/pkg/DESCR
/usr/ports/devel/py-loguru/Makefile
/usr/ports/devel/py-loguru/distinfo
$
and after that you may try make ... inside /usr/ports/devel/py-loguru
Thank you for uploading and sharing the port sourcing.
I was able to run the tests using make test but... I still got no errors. :o
All multiprocessing tests succeeded.
This may be due to the difference between the Python versions tested. I'll try again with OpenBSD 7.6 when I have some time in the next days.
@Delgan do you use virtual machine or a real one?
A virtual one.
How many cores has it got?
Good point, the virtual machine was configured with only one running core.
Let me re-install OpenBSD 7.6 with a multi-core VM and see what happens.
Hey @catap.
The other day, I managed to reproduce the problem thanks to the port sources you shared with me, running OpenBSD 7.6 and Python 3.11.10 on a virtual machine with 8 processors.
Today, I investigated the issue further, and found out that the error is present in 0.7.2 but appears to be fixed on the master branch. After a shot of git bisect, it seems the problem was fixed by this commit: 268bd3c1638b5f9e3cb0d99c9d29fbfd98cc7dfd.
I can't say for sure why exactly this test used to fail on OpenBSD and not other operating systems, though. That's certainly related to implementation details or memory management of KqueueSelector() as indicated by the warning.
Anyway, the fix should be available when I publish the next version (for which I don't have any ETA now). :+1:
Thanks,
I think this issue should be closed as fixed.
OpenBSD uses a lot of randomization in memory allocation which knwon to increase probability to trigger bugs. Probably this is happening here.
Yes, I'll close the ticket then. Thank you for your time.