[gnome-settings-daemon/benzea/tests-output-checker-testing] tests: try closing writer later
- From: Benjamin Berg <bberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon/benzea/tests-output-checker-testing] tests: try closing writer later
- Date: Mon, 15 Feb 2021 14:16:04 +0000 (UTC)
commit 80b0f11d022c9204ee4dccc2e502580615ce707b
Author: Benjamin Berg <bberg redhat com>
Date: Mon Feb 15 15:15:40 2021 +0100
tests: try closing writer later
tests/output_checker.py | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/tests/output_checker.py b/tests/output_checker.py
index 54b3aa70..b911a444 100644
--- a/tests/output_checker.py
+++ b/tests/output_checker.py
@@ -145,7 +145,17 @@ class OutputChecker(object):
def force_close(self):
os.write(1, b"force closing pipe %d" % self._pipe_fd_r);
- os.close(self._pipe_fd_r)
+
+ fd = self._pipe_fd_r
+ self._pipe_fd_r = -1
+ os.close(fd)
+
+ # Write EOF
+ os.write(fd, b"")
+ fd = self._pipe_fd_w
+ self._pipe_fd_w = -1
+ os.close(fd)
+
os.write(1, b"pipe closed, waiting\n");
self._thread.join()
os.write(1, b"reader thread joined\n");
@@ -155,6 +165,5 @@ class OutputChecker(object):
return self._pipe_fd_w
def writer_attached(self):
- os.close(self._pipe_fd_w)
- self._pipe_fd_w = -1
+ pass
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]