Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions source/MRTest/MRCPRTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ TEST( MRViewer, CPRTestGet )

for ( int i = 0; i < MAX_RETRIES; ++i )
{
auto code = cpr::Get( cpr::Url{ baseUrl }, cpr::Timeout{ 3000 }, parameters ).status_code;
const auto resp = cpr::Get( cpr::Url{ baseUrl }, cpr::Timeout{ 3000 }, parameters );
auto code = resp.status_code;
if ( code == 200 )
break;
spdlog::warn( "status code {} after try #{}", code, i + 1 );
if ( resp.error )
spdlog::warn( "curl error {}: {}", (int32_t)resp.error.code, resp.error.message );
if ( i + 1 == MAX_RETRIES )
{
EXPECT_EQ( code, 200 );
Expand All @@ -44,10 +47,13 @@ TEST( MRViewer, CPRTestPost )

for ( int i = 0; i < MAX_RETRIES; ++i )
{
auto code = cpr::Post( cpr::Url{ baseUrl }, cpr::Timeout{ 3000 }, payload ).status_code;
const auto resp = cpr::Post( cpr::Url{ baseUrl }, cpr::Timeout{ 3000 }, payload );
auto code = resp.status_code;
if ( code == 200 )
break;
spdlog::warn( "status code {} after try #{}", code, i + 1 );
if ( resp.error )
spdlog::warn( "curl error {}: {}", (int32_t)resp.error.code, resp.error.message );
if ( i + 1 == MAX_RETRIES )
{
EXPECT_EQ( code, 200 );
Expand Down
Loading