Some times the media/tree URI tests will fail with a timeout trying to connect to the server. Treat this as non-fatal since it will usually just indicate a transient network or server failure. Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx> --- tests/test-mediauris.c | 13 +++++++++---- tests/test-treeuris.c | 13 +++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/tests/test-mediauris.c b/tests/test-mediauris.c index c906f08..220dfb8 100644 --- a/tests/test-mediauris.c +++ b/tests/test-mediauris.c @@ -46,11 +46,16 @@ static void test_media(OsinfoMediaList *medialist, GError **error, CURL *curl) curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code); g_test_message("res=%d, %s; code=%ld", res, curl_easy_strerror(res), response_code); - if (res != CURLE_OK) { - g_printerr("Failed URI %s res=%d (%s) code=%ld\n", - url, res, curl_easy_strerror(res), response_code); + + if (res == CURLE_OPERATION_TIMEDOUT) { + g_printerr("Ignoring network timeout failure for %s\n", url); + } else { + if (res != CURLE_OK) { + g_printerr("Failed URI %s res=%d (%s) code=%ld\n", + url, res, curl_easy_strerror(res), response_code); + } + g_assert_cmpint(res, ==, CURLE_OK); } - g_assert_cmpint(res, ==, CURLE_OK); tmp = tmp->next; } diff --git a/tests/test-treeuris.c b/tests/test-treeuris.c index b0cddbf..26c949b 100644 --- a/tests/test-treeuris.c +++ b/tests/test-treeuris.c @@ -46,11 +46,16 @@ static void test_tree(OsinfoTreeList *treelist, GError **error, CURL *curl) curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code); g_test_message("res=%d, %s; code=%ld", res, curl_easy_strerror(res), response_code); - if (res != CURLE_OK) { - g_printerr("Failed URI %s res=%d (%s) code=%ld\n", - url, res, curl_easy_strerror(res), response_code); + + if (res == CURLE_OPERATION_TIMEDOUT) { + g_printerr("Ignoring network timeout failure for %s\n", url); + } else { + if (res != CURLE_OK) { + g_printerr("Failed URI %s res=%d (%s) code=%ld\n", + url, res, curl_easy_strerror(res), response_code); + } + g_assert_cmpint(res, ==, CURLE_OK); } - g_assert_cmpint(res, ==, CURLE_OK); tmp = tmp->next; } -- 2.19.1 _______________________________________________ Libosinfo mailing list Libosinfo@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libosinfo