Merge ~kissiel/checkbox-support:fix-1741217-broken-pipe-fwts into checkbox-support:master

Proposed by Maciej Kisielewski
Status: Merged
Approved by: Maciej Kisielewski
Approved revision: 2d154c8ed95fc73b58fe19457ad6f7f1b4bbc6b3
Merged at revision: 0e6ee6082903f19b0ede0db43c2b4fabf3a875ea
Proposed branch: ~kissiel/checkbox-support:fix-1741217-broken-pipe-fwts
Merge into: checkbox-support:master
Diff against target: 26 lines (+6/-2)
1 file modified
checkbox_support/scripts/fwts_test.py (+6/-2)
Reviewer Review Type Date Requested Status
Jonathan Cave (community) Approve
Review via email: mp+335725@code.launchpad.net

Description of the change

Fixes broken pipe that occurs on Artful in FWTS.

Somehow on artful zenity terminates before we flush it. I recon it has something to do with the DISPLAY being not available somehow in the middle of the test...

This fix doesn't really cure that situation, but handles symptoms (broken pipe traceback) gracefully.

To test it follow bug report and do what Taihsiang did.

To post a comment you must log in.
Revision history for this message
Jonathan Cave (jocave) wrote :

LGTM +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/checkbox_support/scripts/fwts_test.py b/checkbox_support/scripts/fwts_test.py
2index d4289df..c6e9963 100644
3--- a/checkbox_support/scripts/fwts_test.py
4+++ b/checkbox_support/scripts/fwts_test.py
5@@ -336,7 +336,10 @@ def main():
6 progress_string).encode('utf-8'))
7 progress_indicator.stdin.write("{}\n".format(
8 progress_pct).encode('utf-8'))
9- progress_indicator.stdin.flush()
10+ if progress_indicator.poll() is None:
11+ # LP: #1741217 process may have already terminated
12+ # flushing its stdin would yield broken pipe
13+ progress_indicator.stdin.flush()
14 elif "dialog" in detect_progress_indicator():
15 progress_indicator.stdin.write("XXX\n".encode('utf-8'))
16 progress_indicator.stdin.write(
17@@ -347,7 +350,8 @@ def main():
18 progress_string.encode('utf-8'))
19 progress_indicator.stdin.write(
20 "\nXXX\n".encode('utf-8'))
21- progress_indicator.stdin.flush()
22+ if progress_indicator.poll() is None:
23+ progress_indicator.stdin.flush()
24 else:
25 print(progress_string)
26 if detect_progress_indicator():

Subscribers

People subscribed via source and target branches