From 640d60855d7a9d86b28c9c80c1c2dc7d6fe2e8b6 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Thu, 15 Mar 2018 23:05:00 +0100 Subject: tests: Disable buffering for most files If the output (or input) is buffered, then the tests might not be able to read the log entries right away, causing the test to fail. Explicitly add buffering=0 to open calles where this might be relevant. --- tests/gsdtestcase.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/gsdtestcase.py b/tests/gsdtestcase.py index 67916330..a3515c07 100644 --- a/tests/gsdtestcase.py +++ b/tests/gsdtestcase.py @@ -137,7 +137,7 @@ class GSDTestCase(X11SessionTestCase): # You can rename the log file to *.log if you want to see it on test # case failures - klass.monitor_log = open(os.path.join(klass.workdir, 'dbus-monitor.out'), 'wb') + klass.monitor_log = open(os.path.join(klass.workdir, 'dbus-monitor.out'), 'wb', buffering=0) klass.monitor = subprocess.Popen(['dbus-monitor', '--monitor'], stdout=klass.monitor_log, stderr=subprocess.STDOUT) @@ -172,7 +172,7 @@ class GSDTestCase(X11SessionTestCase): def start_mutter(klass): ''' start mutter ''' - klass.mutter_log = open(os.path.join(klass.workdir, 'mutter.log'), 'wb') + klass.mutter_log = open(os.path.join(klass.workdir, 'mutter.log'), 'wb', buffering=0) # See https://gitlab.gnome.org/GNOME/mutter/merge_requests/15 klass.mutter = subprocess.Popen(['mutter', '--x11'], stdout=klass.mutter_log, -- cgit v1.2.1