You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AssertionError: can only test a child process
File "/usr/lib/python3.11/multiprocessing/util.py", line 300, in _run_finalizers
finalizer()
File "/usr/lib/python3.11/multiprocessing/util.py", line 224, in __call__
res = self._callback(*self._args, **self._kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<venv>/lib/python3.11/site-packages/viztracer/viztracer.py", line 303, in exit_routine
self.stop()
File "<venv>/lib/python3.11/site-packages/viztracer/viztracer.py", line 186, in stop
self._plugin_manager.event("post-stop")
File "<venv>/lib/python3.11/site-packages/viztracer/vizplugin.py", line 122, in event
self._send_message(plugin, "event", {"when": when})
File "<venv>/lib/python3.11/site-packages/viztracer/vizplugin.py", line 110, in _send_message
ret = plugin.message(m_type, payload)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<venv>/lib/python3.11/site-packages/vizplugins/psutil_monitor.py", line 27, in message
return self.stop_recording()
^^^^^^^^^^^^^^^^^^^^^
File "<venv>/lib/python3.11/site-packages/vizplugins/psutil_monitor.py", line 47, in stop_recording
self.recordings.append(self.send_action("stop"))
^^^^^^^^^^^^^^^^^^^^^^^^
File "<venv>/lib/python3.11/site-packages/vizplugins/psutil_monitor.py", line 75, in send_action
if not self.cpu_process.is_alive():
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/multiprocessing/process.py", line 160, in is_alive
assert self._parent_pid == os.getpid(), 'can only test a child process'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: can only test a child process
I ended up creating a custom reporter that logs system-wide CPU and RAM usage to a VizCounter from a thread of the main process as a workaround.
The text was updated successfully, but these errors were encountered:
I wanted to track CPU and memory usage of a program that uses subprocesses and found that using vizplugins crashes when the first subprocess closes.
For example:
Run with
Crashes with:
I ended up creating a custom reporter that logs system-wide CPU and RAM usage to a
VizCounter
from a thread of the main process as a workaround.The text was updated successfully, but these errors were encountered: