Test battery_percentage with upower fails randomly
NoahGorny opened this issue · comments
Noah Gorny commented
see link
it seems like sometimes we get a broken pipe, even without echoing twice..
What do you think @gaelicWizard ?
John D Pell commented
I think that Bash has a bug with handling SIGPIPE
sometimes, but I think that this may work with `echo "$BAT0"$'\n'"/path/to/$RANDOM" so that it's one write. I have that somewhere in another branch I'm trying out.
I suspect that trap '' PIPE
may alsö work (install a signal handler, but empty), but I'm reluctant to do any signal handling within BATS without lots of care.
John D Pell commented
John D Pell commented
Ok! New PR #2105 fixes this testing error by avoiding the closed pipe entirely.