When testing on a pi3b+ / UC18:
-------------[ Running job 27 / 27. Estimated time left: unknown ]--------------
[ Test system can get beacon EddyStone URL advertisements on the hci0 adapter ]-
ID: com.canonical.certification::bluetooth4/beacon_eddystone_url_hci0
Category: com.canonical.plainbox::bluetooth
... 8< -------------------------------------------------------------------------
2019-01-14 12:37:25,726 - iCMD:bluetoothctl - WARNING - Broken pipe when sending to the process!
Traceback (most recent call last):
File "/snap/checkbox-snappy/1679/bin/checkbox-support-eddystone_scanner", line 11, in <module>
load_entry_point('checkbox-support==0.40.0.dev0', 'console_scripts', 'checkbox-support-eddystone_scanner')()
File "/snap/checkbox-snappy/1679/lib/python3.6/site-packages/checkbox_support/scripts/eddystone_scanner.py", line 72, in main
btctl.writeline('exit')
File "/snap/checkbox-snappy/1679/lib/python3.6/site-packages/checkbox_support/interactive_cmd.py", line 84, in writeline
self._proc.stdin.flush()
BrokenPipeError: [Errno 32] Broken pipe
------------------------------------------------------------------------- >8 ---
Outcome: job failed
I tried multiple scenarios to make this BrokenPipeError surface, and all the ones that ended with BrokenPipes are valid and expected.
To be more specific - if the BrokenPipe is emitted it means that client of the icmd wrote to the dead process. If the client expected the subprocess to be alive and it wasn’t, then for me, the client should catch that BrokenPipe and make use of that info.
For instance in the eddystone_ scanner. py case I think that if the process dies immediately after spawning it means something is wrong with the setup, and the BrokenError is just a symptom of that.
As an experiment I changed the command used in icmd in eddystone_ scanner. py to be bash (or sleep 20) and the test didn’t care - it did not crashed, just assumed everything went OK.
When I changed it to “false” which exits quite fast, it got BrokenPipe, which is kinda expected.
I don’t think it can be fixed here.