Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test battery_percentage with upower fails randomly #2104

Closed
NoahGorny opened this issue Mar 3, 2022 · 3 comments · Fixed by #2105
Closed

Test battery_percentage with upower fails randomly #2104

NoahGorny opened this issue Mar 3, 2022 · 3 comments · Fixed by #2105

Comments

@NoahGorny
Copy link
Member

see link
it seems like sometimes we get a broken pipe, even without echoing twice..

What do you think @gaelicWizard ?

@gaelicWizard
Copy link
Contributor

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.

@gaelicWizard
Copy link
Contributor

gaelicWizard commented Mar 4, 2022

Seems my attempt at echo was part of #2061 and doesn't work. I've added a conservative application of trap '' PIPE to #2031, which seems good so far...

EDIT: nope, that didn't work either...

@gaelicWizard
Copy link
Contributor

Ok! New PR #2105 fixes this testing error by avoiding the closed pipe entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants