-
Notifications
You must be signed in to change notification settings - Fork 69
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
core: Add support for retrieving CURL error messages, handle unexpected CURL return code on macOS, and log such codes in tests (fixes #519). #517
Conversation
"Unexpected CURL error code: " + std::to_string(actual) | ||
+ "; expected: " + std::to_string(expected) | ||
}; | ||
FAIL(error_message); |
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.
Based on https://curl.se/libcurl/c/libcurl-errors.html, can we also use CURLOPT_ERRORBUFFER so that we can get more details about the error (e.g., what specific HTTP error >= 400 it was)?
Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com>
Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com>
NetworkReader
unit tests on unexpected CURL
return code.NetworkReader
unit tests on unexpected CURL
return code (fixes #519).
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.
For the PR title, how about:
core: Add support for retrieving CURL error messages, handle unexpected CURL return code on macOS, and log such codes in tests (fixes #519).
Can you:
|
NetworkReader
unit tests on unexpected CURL
return code (fixes #519).
centOS build failed due to issue #521 which is not related to this PR. |
Description
This PR fixes #519.
In recent workflows, we found that some macOS build failed because of the unit test failures. By further investigation, it is because HTTP error code 416 is not handled as
CURL_HTTP_RETURNED_ERROR
in thelibcurl
version of the GH macOS runner. The same issue won't be reproduced in ubuntu 20.04 or 22.04 even with the same version oflibcurl
. Therefore, this PR adds special handling for macOS to address the failure in the unit test cases.In addition, as we were approaching the cause of the failure, we realized the CURL error message could be helpful. Therefore, we also add support for retrieving CURL error messages through the
CurlDownloadHandler
to improve the debugability of our CURL utilities. In the unit test, we add logs to print out the error messages when the CURL return code doesn't match the expected one.Validation performed