aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2024-02-24 16:31:13 -0800
committerZac Medico <zmedico@gentoo.org>2024-02-24 16:42:46 -0800
commit9e84ef57ba747766c9147c1ac1b247faa1f05956 (patch)
tree618f272d60e6a02f955fd5995dc2ea358b1fdb2a
parentprocess.spawn: Fix logic for missing libc.unshare on musl (diff)
downloadportage-9e84ef57ba747766c9147c1ac1b247faa1f05956.tar.gz
portage-9e84ef57ba747766c9147c1ac1b247faa1f05956.tar.bz2
portage-9e84ef57ba747766c9147c1ac1b247faa1f05956.zip
testSpawnReturnProcTerminate: Fix integer in spawn command argument
The invalid integer in the spawn command argument intermittently triggered this error when SIGTERM did not arrive until after the exec call: ----------------------------- Captured stderr call ----------------------------- Process ForkProcess-23: Traceback (most recent call last): File "/home/runner/work/portage/portage/lib/portage/process.py", line 818, in _exec_wrapper _exec( File "/home/runner/work/portage/portage/lib/portage/process.py", line 1068, in _exec _exec2( File "/home/runner/work/portage/portage/lib/portage/process.py", line 1166, in _exec2 os.execve(binary, myargs, env) TypeError: expected str, bytes or os.PathLike object, not int During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/home/runner/work/portage/portage/lib/portage/util/_async/ForkProcess.py", line 328, in _bootstrap sys.exit(target(*(args or []), **(kwargs or {}))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/work/portage/portage/lib/portage/process.py", line 1441, in __call__ return self._target(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/work/portage/portage/lib/portage/process.py", line 853, in _exec_wrapper writemsg(f"{e}:\n {' '.join(mycommand)}\n", noiselevel=-1) ^^^^^^^^^^^^^^^^^^^ TypeError: sequence item 1: expected str instance, int found Bug: https://bugs.gentoo.org/916566#c20 Signed-off-by: Zac Medico <zmedico@gentoo.org>
-rw-r--r--lib/portage/tests/process/test_spawn_returnproc.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/portage/tests/process/test_spawn_returnproc.py b/lib/portage/tests/process/test_spawn_returnproc.py
index 6d823d9c3..8fbf54d0d 100644
--- a/lib/portage/tests/process/test_spawn_returnproc.py
+++ b/lib/portage/tests/process/test_spawn_returnproc.py
@@ -32,7 +32,7 @@ class SpawnReturnProcTestCase(TestCase):
loop = global_event_loop()
async def watch_pid():
- proc = spawn([sleep_binary, 9999], returnproc=True)
+ proc = spawn([sleep_binary, "9999"], returnproc=True)
proc.terminate()
self.assertEqual(await proc.wait(), -signal.SIGTERM)