summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2020-02-06 15:59:49 +0100
committerOndrej Holy <oholy@redhat.com>2020-02-10 14:26:12 +0000
commit47fd82a50b157a2ac3919bbc9655dd65ff7d8436 (patch)
tree20a40cc582c94a52036dafbeb7f498f596115d00 /test
parent8258ae4e341d49923ed4532ad463589cfa34cb16 (diff)
downloadgvfs-47fd82a50b157a2ac3919bbc9655dd65ff7d8436.tar.gz
tests: Increase size for pipes to avoid hangs
glib-networking started printing big amount of debug info which cause test suite hangs. It is because the stdout/stderr is redirected to pipes, which have limited capacity. Let's increase the pipe capacity to its maximum to fix this issue. Fixes: https://gitlab.gnome.org/GNOME/gvfs/issues/451
Diffstat (limited to 'test')
-rwxr-xr-xtest/gvfs-test6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/gvfs-test b/test/gvfs-test
index 2c37deeb..4361f798 100755
--- a/test/gvfs-test
+++ b/test/gvfs-test
@@ -1838,6 +1838,12 @@ def start_dbus():
flags = fcntl.fcntl(dbus_daemon.stderr, fcntl.F_GETFL)
fcntl.fcntl(dbus_daemon.stderr, fcntl.F_SETFL, flags | os.O_NONBLOCK)
+ # set maximal size for pipes to avoid hangs when too many debug info is printed
+ F_SETPIPE_SZ = 1031
+ pipe_max_size = int(open('/proc/sys/fs/pipe-max-size', 'r').read())
+ fcntl.fcntl(dbus_daemon.stdout, F_SETPIPE_SZ, pipe_max_size)
+ fcntl.fcntl(dbus_daemon.stderr, F_SETPIPE_SZ, pipe_max_size)
+
return temp_home