This was getting stressed in new ways by
TestSessionMap.test_session_reject, which
has a mount that fails initially.
Two changes here:
* Raise CommandFailedError instead of RuntimeError when
a mount fails (i.e. catch process termination instead
of timing out on /sys/ population)
* Generalise error handling on umount, so that we only
raise the exception on an umount failure if the mount
appears to really not be unmounted. There is some
EINVAL corner case that was getting triggered by the test.
Signed-off-by: John Spray <john.spray@redhat.com>
post_mount_conns = list_connections()
while len(post_mount_conns) <= len(pre_mount_conns):
+ if self.fuse_daemon.finished:
+ # Did mount fail? Raise the CommandFailedError instead of
+ # hitting the "failed to populate /sys/" timeout
+ self.fuse_daemon.wait()
time.sleep(1)
waited += 1
if waited > timeout:
stderr=stderr
)
except CommandFailedError:
- if "not found" in stderr.getvalue():
- # Missing mount point, so we are unmounted already, yay.
- pass
- else:
+ if self.is_mounted():
raise
assert not self.is_mounted()