Added checks to help diagnose intermittent globalCleanUp test failure (#4593)
* Added checks to help diagnose intermittent globalCleanUp test failure
This commit is contained in:
parent
d8ae044434
commit
2cce17d691
@ -23,6 +23,7 @@
|
||||
// Define the class name that reads from ConnectionPool private members
|
||||
namespace Azure { namespace Core { namespace Test {
|
||||
class CurlConnectionPool_connectionPoolTest_Test;
|
||||
class SdkWithLibcurl_globalCleanUp_Test;
|
||||
}}} // namespace Azure::Core::Test
|
||||
#endif
|
||||
|
||||
@ -43,6 +44,7 @@ namespace Azure { namespace Core { namespace Http {
|
||||
#ifdef TESTING_BUILD
|
||||
// Give access to private to this tests class
|
||||
friend class Azure::Core::Test::CurlConnectionPool_connectionPoolTest_Test;
|
||||
friend class Azure::Core::Test::SdkWithLibcurl_globalCleanUp_Test;
|
||||
#endif
|
||||
private:
|
||||
/**
|
||||
|
||||
@ -46,6 +46,12 @@ namespace Azure { namespace Core { namespace Test {
|
||||
session->Perform(Azure::Core::Context::ApplicationContext);
|
||||
// Reading all the response
|
||||
session->ReadToEnd(Azure::Core::Context::ApplicationContext);
|
||||
|
||||
// If all three of these conditions are true, the connection should be moved to the connection
|
||||
// pool.
|
||||
EXPECT_TRUE(session->IsEOF());
|
||||
EXPECT_TRUE(session->m_keepAlive);
|
||||
EXPECT_FALSE(session->m_connectionUpgraded);
|
||||
}
|
||||
// Check that after the connection is gone, it is moved back to the pool
|
||||
EXPECT_EQ(
|
||||
@ -57,10 +63,10 @@ namespace Azure { namespace Core { namespace Test {
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
// Declare a signal handler to report unhandled exceptions on Windows - this is not needed for
|
||||
// other OS's as they will print the exception to stderr in their terminate() function.
|
||||
// Declare a signal handler to report unhandled exceptions on Windows - this is not needed for
|
||||
// other OS's as they will print the exception to stderr in their terminate() function.
|
||||
#if defined(AZ_PLATFORM_WINDOWS)
|
||||
// Ensure that all calls to abort() no longer pop up a modal dialog on Windows.
|
||||
// Ensure that all calls to abort() no longer pop up a modal dialog on Windows.
|
||||
#if defined(_DEBUG) && defined(_MSC_VER)
|
||||
_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG);
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user