-
Notifications
You must be signed in to change notification settings - Fork 559
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
compel/test: Fix success condition check in fdspy #2192
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## criu-dev #2192 +/- ##
============================================
+ Coverage 70.74% 70.77% +0.02%
============================================
Files 133 133
Lines 33244 33233 -11
============================================
+ Hits 23518 23520 +2
+ Misses 9726 9713 -13
☔ View full report in Codecov by Sentry. |
Hi @ancientmodern ! Thanks for looking into it. Speaking about RISC-V support, Yixue (@felicitia) working on that closely. Are your really working on that too? I think you need to contact Yixue then. Now about your fix. As far as I understand this inconsistency appeared after this commit 5364ca3 |
Thanks for pointing this out Alex! I agree, |
Thank you for the feedback Alex! Yeah I've contacted Yixue and we are working together on RISC-V support. As per Yixue's recent update in #1702, we've successfully enabled most of compel to function on RISC-V, and we are actively addressing a few remaining bugs :) I agree it's better to consistently return 0 in case of error and will make the changes. As this is a fix to a previous commit, do I need to follow the guideline about "fix tags" mentioned here? Edit: I've updated my commit. Please let me know if there is any issue I need to resolve :) |
This commit revises the error handling in the fdspy test. Previously, a failure case could have been incorrectly reported as successful because of a specific check `pass != 0`, leading to potential false positives when `check_pipe_ends()` returned `-1` due to a read/write pipe error. To improve this, we've adjusted the error handling to return `0` in case of any error. As such, the final success condition remains unchanged. This approach will help accurately differentiate between successful and failed cases, ensuring the output "All OK" is printed for success, and "Something went WRONG" for any failure. Fixes: 5364ca3 ("compel/test: Fix warn_unused_result") Signed-off-by: Haorong Lu <ancientmodern4@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Found this bug when working on adding riscv64 support to compel #1702 :) Specifically, the bug appeared when the
p_err
pipe became broken after resuming, causingcheck_pipe_ends()
to hit either these branches:The -1 return value was not correctly handled in the final check:
This pull request modified the condition to
pass == 1
, ensuring that "All OK" is printed only whencheck_pipe_ends()
returns 1 (indicating a successful case), and any other value will correctly result in "Something went WRONG" being printed.