Xpra: Ticket #2103: server auth test fails on macos

2019-01-11 14:09:24,288 authenticate(..) returncode(['/usr/bin/true', 'Connection request from fake-connection-data', '2'])=0
2019-01-11 14:09:24,289 exec.Authenticator(foo, {'command': '/usr/bin/false', 'timeout': 2, 'connection': 'fake-connection-data'})
2019-01-11 14:09:24,289 exec connection info: fake-connection-data
2019-01-11 14:09:24,289 cannot load password database entry for 'foo'
Traceback (most recent call last):
  File "/Users/gtk3/Xpra/trunk/src/xpra/server/auth/sys_auth_base.py", line 199, in __init__
    self.pw = pwd.getpwnam(username)
KeyError: "getpwnam(): name not found: 'foo'"
2019-01-11 14:09:24,292 authenticate(..) Popen(['/usr/bin/false', 'Connection request from fake-connection-data', '2'])=<subprocess.Popen object at 0x10b1ae550>
2019-01-11 14:09:24,292 add_process(<subprocess.Popen object at 0x10b1ae550>, exec auth, ['/usr/bin/false', 'Connection request from fake-connection-data', '2'], True, True) pid=34975
2019-01-11 14:09:24,293 sigchld(20, <frame at 0x10aae9da0, file '/Users/gtk3/gtk/inst/lib/python3.7/subprocess.py', line 1582, code _try_wait>)
2019-01-11 14:09:24,293 poll() procinfo list: [ProcInfo({'pid': 34975, 'name': 'exec auth', 'command': ['/usr/bin/false', 'Connection request from fake-connection-data', '2'], 'ignore': True, 'forget': True, 'callback': <bound method Authenticator.command_ended of exec>, 'process': <subprocess.Popen object at 0x10b1ae550>, 'returncode': None, 'dead': False})]
2019-01-11 14:09:24,293 reap() calling os.waitpid(-1, 'WNOHANG')
2019-01-11 14:09:24,293 reap() waitpid=34975
2019-01-11 14:09:24,294 add_dead_pid(34975) matches=[ProcInfo({'pid': 34975, 'name': 'exec auth', 'command': ['/usr/bin/false', 'Connection request from fake-connection-data', '2'], 'ignore': True, 'forget': True, 'callback': <bound method Authenticator.command_ended of exec>, 'process': <subprocess.Popen object at 0x10b1ae550>, 'returncode': None, 'dead': False})]
2019-01-11 14:09:24,294 add_dead_process(ProcInfo({'pid': 34975, 'name': 'exec auth', 'command': ['/usr/bin/false', 'Connection request from fake-connection-data', '2'], 'ignore': True, 'forget': True, 'callback': <bound method Authenticator.command_ended of exec>, 'process': <subprocess.Popen object at 0x10b1ae550>, 'returncode': None, 'dead': False}))
2019-01-11 14:09:24,294 add_dead_process returncode=None, dead=False, callback=<bound method Authenticator.command_ended of exec>
2019-01-11 14:09:24,294 Warning: process 'exec auth' is still running
2019-01-11 14:09:24,294 reap() calling os.waitpid(-1, 'WNOHANG')
2019-01-11 14:09:24,294 authenticate(..) returncode(['/usr/bin/false', 'Connection request from fake-connection-data', '2'])=0
FAIL


Fri, 11 Jan 2019 17:14:12 GMT - Antoine Martin: status changed

This doesn't make sense:

$ python
Python 3.7.2 (default, Jan 11 2019, 12:43:26)
[Clang 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from subprocess import Popen
>>> cmd=['/usr/bin/false', 'Connection request from fake-connection-data', '2']
>>> proc = Popen(cmd, close_fds=True, shell=False)
>>> proc.wait()
1

Fri, 11 Jan 2019 17:39:40 GMT - Antoine Martin: status changed; resolution set

Looks like a python2 macos bug with poll():

python
>>> import time
>>> from subprocess import Popen
>>> cmd=['/usr/bin/false', 'Connection request from fake-connection-data', '2']
>>> proc = Popen(cmd, close_fds=True, shell=False)
>>> proc.poll()
0
$ python3
Python 3.7.2 (default, Jan 11 2019, 12:43:26)
[Clang 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from subprocess import Popen
>>> cmd=['/usr/bin/false', 'Connection request from fake-connection-data', '2']
>>> proc = Popen(cmd, close_fds=True, shell=False)
>>> proc.poll()
1

Workaround in r21343. python3 still failed during the unit tests, so r21344 applies the workaround to both python versions.


Sat, 23 Jan 2021 05:42:17 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/2103