tommilligan / pytest-jobserver

Limit parallel tests with posix jobserver.
Apache License 2.0
2 stars 0 forks source link

ValueError: invalid literal for int() with base 10: 'fifo:/tmp/GMfifo519308' #146

Open vbraun opened 8 months ago

vbraun commented 8 months ago

When I run pytest-jobserver I get an error

$ make -j3 test-python-pytest
[...]
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/vbraun/Talque-4/tools/talque3/lib/python3.10/site-packages/_pytest/main.py", line 269, in wrap_session
INTERNALERROR>     config._do_configure()
INTERNALERROR>   File "/home/vbraun/Talque-4/tools/talque3/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1074, in _do_configure
INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR>   File "/home/vbraun/Talque-4/tools/talque3/lib/python3.10/site-packages/pluggy/_hooks.py", line 523, in call_historic
INTERNALERROR>     res = self._hookexec(self.name, self._hookimpls.copy(), kwargs, False)
INTERNALERROR>   File "/home/vbraun/Talque-4/tools/talque3/lib/python3.10/site-packages/pluggy/_manager.py", line 119, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/home/vbraun/Talque-4/tools/talque3/lib/python3.10/site-packages/pluggy/_callers.py", line 138, in _multicall
INTERNALERROR>     raise exception.with_traceback(exception.__traceback__)
INTERNALERROR>   File "/home/vbraun/Talque-4/tools/talque3/lib/python3.10/site-packages/pluggy/_callers.py", line 102, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/home/vbraun/Talque-4/tools/talque3/lib/python3.10/site-packages/pytest_jobserver/plugin.py", line 58, in pytest_configure
INTERNALERROR>     or jobserver_from_env_make(config)
INTERNALERROR>   File "/home/vbraun/Talque-4/tools/talque3/lib/python3.10/site-packages/pytest_jobserver/configure.py", line 65, in jobserver_from_env_make
INTERNALERROR>     fd_read, fd_write = tuple(FileDescriptor(int(fd)) for fd in fds.split(","))
INTERNALERROR>   File "/home/vbraun/Talque-4/tools/talque3/lib/python3.10/site-packages/pytest_jobserver/configure.py", line 65, in <genexpr>
INTERNALERROR>     fd_read, fd_write = tuple(FileDescriptor(int(fd)) for fd in fds.split(","))
INTERNALERROR> ValueError: invalid literal for int() with base 10: 'fifo:/tmp/GMfifo519308'
make: *** [Makefile:295: test-python-pytest] Error 3

Presumably the MAKEFLAGS format changed (actual value is -j3 --jobserver-auth=fifo:/tmp/GMfifo519308). For the record, my make version is

$ make --version
GNU Make 4.4.1
Built for x86_64-redhat-linux-gnu
Copyright (C) 1988-2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

There is now a library to just interact with the Make jobserver at https://github.com/milahu/gnumake-tokenpool, one idea might be to use that instead of rolling your own MAKEFLAGS parser.

tommilligan commented 8 months ago

Hi, thanks for the bug report.

I don't actively use this project any more/see it in popular use, so I don't plan to contribute actively to it.

However I'm happy to review PRs and/or add you as a co-maintainer, if you want to.

I am happy with either using a library for the flag parsing (good suggestion), or just hacking in the additional logic required.