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
diff --git a/checkbox_support/scripts/fwts_test.py b/checkbox_support/scripts/fwts_test.py
index d4289df..c6e9963 100644
--- a/checkbox_support/scripts/fwts_test.py
+++ b/checkbox_support/scripts/fwts_test.py
@@ -336,7 +336,10 @@ def main():
336 progress_string).encode('utf-8'))336 progress_string).encode('utf-8'))
337 progress_indicator.stdin.write("{}\n".format(337 progress_indicator.stdin.write("{}\n".format(
338 progress_pct).encode('utf-8'))338 progress_pct).encode('utf-8'))
339 progress_indicator.stdin.flush()339 if progress_indicator.poll() is None:
340 # LP: #1741217 process may have already terminated
341 # flushing its stdin would yield broken pipe
342 progress_indicator.stdin.flush()
340 elif "dialog" in detect_progress_indicator():343 elif "dialog" in detect_progress_indicator():
341 progress_indicator.stdin.write("XXX\n".encode('utf-8'))344 progress_indicator.stdin.write("XXX\n".encode('utf-8'))
342 progress_indicator.stdin.write(345 progress_indicator.stdin.write(
@@ -347,7 +350,8 @@ def main():
347 progress_string.encode('utf-8'))350 progress_string.encode('utf-8'))
348 progress_indicator.stdin.write(351 progress_indicator.stdin.write(
349 "\nXXX\n".encode('utf-8'))352 "\nXXX\n".encode('utf-8'))
350 progress_indicator.stdin.flush()353 if progress_indicator.poll() is None:
354 progress_indicator.stdin.flush()
351 else:355 else:
352 print(progress_string)356 print(progress_string)
353 if detect_progress_indicator():357 if detect_progress_indicator():

Subscribers

People subscribed via source and target branches