summaryrefslogtreecommitdiff
path: root/test/gvfs-test
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2013-06-13 15:06:09 +0200
committerMartin Pitt <martinpitt@gnome.org>2013-06-13 15:09:18 +0200
commit025792d444cbbc12e0d64969c59645f5d7fac174 (patch)
tree7249775f900fe277d89f0510d90d4d066ebfbb3b /test/gvfs-test
parent45f1243fd2ed2129caebdc1b55d1d8a255418a18 (diff)
downloadgvfs-025792d444cbbc12e0d64969c59645f5d7fac174.tar.gz
gvfs-test: More robust cleanup of temporary home directory
Especially the trash:// tests have a tendency to leave the gvfs-metadata child around a little while after killing the D-BUS daemon, and thus leaving the temporary home directory busy. Retry for a few times to allow gvfsd-metadata to clean up itself.
Diffstat (limited to 'test/gvfs-test')
-rwxr-xr-xtest/gvfs-test14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/gvfs-test b/test/gvfs-test
index 1da2a8fa..5360f62c 100755
--- a/test/gvfs-test
+++ b/test/gvfs-test
@@ -1671,4 +1671,16 @@ if __name__ == '__main__':
if not in_testbed:
dbus_daemon.terminate()
dbus_daemon.wait()
- shutil.rmtree(temp_home)
+ # it might take a while until the child processes terminate and
+ # release usage of the home dir, so try several times
+ timeout = 20
+ while timeout > 0:
+ try:
+ shutil.rmtree(temp_home)
+ break
+ except OSError as e:
+ timeout -= 1
+ time.sleep(0.1)
+ if timeout <= 0:
+ raise
+