Hello Andrei,this was a tough one, but we have circular dependency in pickled files again (I remember cleaning probably the same one ~5 years ago). An ugly workaround is:
``` diff --git a/virttest/qemu_monitor.py b/virttest/qemu_monitor.py index 8ff872b..48e7ef2 100644 --- a/virttest/qemu_monitor.py +++ b/virttest/qemu_monitor.py@@ -167,6 +167,9 @@ def wait_for_create_monitor(vm, monitor_name, monitor_params, timeout):
else:
raise MonitorConnectError(monitor_name)
+class VM(object):
+ def __init__(self, name):
+ self.name = name
class Monitor:
@@ -188,7 +191,7 @@ class Monitor:
:raise MonitorConnectError: Raised if the connection fails
"""
- self.vm = vm
+ self.vm = VM(vm.name)
self.name = name
self.filename = filename
self._lock = threading.RLock()
```
but I'll come up with a cleaner solution and send a bugfix then... In
the mean time, can you verify this fix works for you as well?
Lukáš Dne 10.2.2017 v 14:05 Andrei Stepanov napsal(a):
Hi For a long time SpiceQE from time to time had this error: Exception thrown while loading env (AttributeError("'VM' object has no attribute 'name'",), <class virttest.qemu_monitor.HumanMonitor at 0x3992a78>, (<virttest.qemu_vm.VM object at 0x3e25950>, 'hmp1', '/var/tmp/avocado_bFZBC6/monitor-hmp1-20170210-134859-mVznyQoq', False)) Creating new, empty env file 2 After which Avocado test process hangs forever. It was very hard to explain. I finally found the cause. It is easy reproduce even with "boot" test. 1. Change boot.py to raise any exception at the beginning of run() function: "raise E...." 2. Run this test with: avocado run --show-job-log boot --vt-extra-params 'kill_vm=no' 'kill_vm_on_error=no' This test will stay active all time no matter what. The problem is: there is active thread: [<_MainThread(MainThread, started 140040446437184)>, <Thread(tail_thread_MwKAuDx9_QEMU_AUDIO, started 140040077772544)>] tail_thread_xxxxxx thread is created at: ./lib/python2.7/site-packages/aexpect/client.py:624: self.tail_thread = threading.Thread(target=self._tail, This is a cause that Avocado process stays active. It reaches exit point: --Return--/mnt/tests/spice/qe-tests/virtualenv/bin/avocado(83)<module>()->None-> sys.exit(app.run()) (Pdb) But running thread doesn't allow to exit: # strace -f -p 22879 Process 22879 attached with 2 threads [pid 22879] select(10, [9], [], [], {0, 17975} <unfinished ...> [pid 22353] futex(0x45e0760, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...> [pid 22879] <... select resumed> ) = 0 (Timeout) [pid 22879] select(10, [9], [], [], {0, 50000}) = 0 (Timeout) [pid 22879] select(10, [9], [], [], {0, 50000}) = 0 (Timeout) [pid 22879] select(10, [9], [], [], {0, 50000}) = 0 (Timeout) [pid 22879] select(10, [9], [], [], {0, 50000}) = 0 (Timeout) Okay. We can set "kill_vm" to "yes". But...... There is something wrong with: kill_vm = no + kill_vm_on_error=no
signature.asc
Description: OpenPGP digital signature
