-
I want to run tests under QEMU on multiple embedded platforms on which I'm working on using labgrid and pytest. Unfortunately, I encounter problems due to ill-timed drivers destruction. Ideally, I would like pytest to start one QEMU instance, run all tests on it, kill it, start new QEMU for the next platform and so on. Pytest tries to do that when fixture is not needed any more, but QEMUDriver doesn't actually get destroyed, because it doesn't have a destructor method. All resources remain acquired. So I end up with a dozen of useless QEMUs running simultaneously and consuming lots of memory and CPU time. Since drivers acquire resources in their constructors, destructor seems to be the best and correct place for releasing these resources. Could you comment why labgrid instead uses atexit()? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
What you want to do is call |
Beta Was this translation helpful? Give feedback.
What you want to do is call
target.deactivate()
after you are done with qemu, this will turn off the qemu instances.