dbus/proxies.py: make _introspect_block wait until reply handler executed
The docstring for self._pending_introspect.block() seems to imply that it waits for the reply handler to be called, but in practice this doesn't mean that the reply handler has finished executing. This can lead to a race between a _introspect_method_map lookup and it being populated on a synchronous call to a _DeferredMethod soon after creation of a ProxyObject. In turn, this leads to failure of method calls in which the signature needs to be inferred.
This can be easily demonstrated by inserting a short sleep at the start of _introspect_reply_handler and observing that _introspect_block() returns prematurely with self._introspect_state still in INTROSPECT_STATE_INTROSPECT_IN_PROGRESS.
Instead, loop until the introspect handler has advanced the state before returning from _introspect_block.
Signed-off-by: Jonathan Davies jonathan.davies@nutanix.com