diff options
author | Mattes D <github@xoft.cz> | 2023-05-09 23:12:51 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2023-05-19 16:25:12 +0200 |
commit | d9b2833e272fa1018058786edef45a42cbe4ecc0 (patch) | |
tree | e536b310149cea83e9fe46fa9fe1c0dff773ca44 /tests | |
parent | cTCPLink and cUrlClient accept list of trusted root CAs for TLS. (diff) | |
download | cuberite-d9b2833e272fa1018058786edef45a42cbe4ecc0.tar cuberite-d9b2833e272fa1018058786edef45a42cbe4ecc0.tar.gz cuberite-d9b2833e272fa1018058786edef45a42cbe4ecc0.tar.bz2 cuberite-d9b2833e272fa1018058786edef45a42cbe4ecc0.tar.lz cuberite-d9b2833e272fa1018058786edef45a42cbe4ecc0.tar.xz cuberite-d9b2833e272fa1018058786edef45a42cbe4ecc0.tar.zst cuberite-d9b2833e272fa1018058786edef45a42cbe4ecc0.zip |
Diffstat (limited to '')
-rw-r--r-- | tests/HTTP/UrlClientTest.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/tests/HTTP/UrlClientTest.cpp b/tests/HTTP/UrlClientTest.cpp index 41d61152e..94ea0ccaa 100644 --- a/tests/HTTP/UrlClientTest.cpp +++ b/tests/HTTP/UrlClientTest.cpp @@ -120,7 +120,11 @@ int TestRequest1() auto res = cUrlClient::Get("http://github.com", std::move(callbacks), AStringMap(), AString(), std::move(options)); if (res.first) { - evtFinished->Wait(); + if (!evtFinished->Wait(10000)) + { + LOG("Aborting the wait for response; failing the test."); + return 1; + } } else { @@ -142,7 +146,11 @@ int TestRequest2() auto res = cUrlClient::Get("http://github.com", std::move(callbacks)); if (res.first) { - evtFinished->Wait(); + if (!evtFinished->Wait(10000)) + { + LOG("Aborting the wait for response; failing the test."); + return 1; + } } else { @@ -166,7 +174,11 @@ int TestRequest3() auto res = cUrlClient::Get("https://github.com", std::move(callbacks), AStringMap(), AString(), std::move(options)); if (res.first) { - evtFinished->Wait(); + if (!evtFinished->Wait(10000)) + { + LOG("Aborting the wait for response; failing the test."); + return 1; + } } else { @@ -188,7 +200,11 @@ int TestRequest4() auto res = cUrlClient::Get("https://github.com", std::move(callbacks)); if (res.first) { - evtFinished->Wait(); + if (!evtFinished->Wait(10000)) + { + LOG("Aborting the wait for response; failing the test."); + return 1; + } } else { |