Skip to content

Commit

Permalink
Revert "Fix integration tests build for custom memory management enab…
Browse files Browse the repository at this point in the history
…led"

This reverts commit ff6d663.
  • Loading branch information
SergeyRyabinin committed Apr 23, 2024
1 parent 542f071 commit 9754f3e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,20 @@ using namespace Aws::Utils;

namespace
{
static Aws::String BASE_CREATE_BUCKET_TEST_NAME = "createbuckettest";
static Aws::String BASE_DNS_UNFRIENDLY_TEST_NAME = "dns.unfriendly";
static Aws::String BASE_LOCATION_BUCKET_TEST_NAME = "locbuckettest";
static Aws::String BASE_OBJECTS_BUCKET_NAME = "objecttest";
static Aws::String BASE_OBJECTS_DEFAULT_CTOR_BUCKET_NAME = "ctortest";
static Aws::String BASE_PUT_OBJECTS_BUCKET_NAME = "putobjecttest";
static Aws::String BASE_PUT_WEIRD_CHARSETS_OBJECTS_BUCKET_NAME = "charsetstest";
static Aws::String BASE_PUT_OBJECTS_PRESIGNED_URLS_BUCKET_NAME = "presignedtest";
static Aws::String BASE_PUT_MULTIPART_BUCKET_NAME = "multiparttest";
static Aws::String BASE_ERRORS_TESTING_BUCKET = "errorstest";
static Aws::String BASE_EVENT_STREAM_TEST_BUCKET_NAME = "eventstream";
static Aws::String BASE_EVENT_STREAM_LARGE_FILE_TEST_BUCKET_NAME = "largeeventstream";
static Aws::String BASE_EVENT_STREAM_ERRORS_IN_EVENT_TEST_BUCKET_NAME = "errorsinevent";
static Aws::String BASE_CHECKSUMS_BUCKET_NAME = "checksums-crt";
static std::string BASE_CREATE_BUCKET_TEST_NAME = "createbuckettest";
static std::string BASE_DNS_UNFRIENDLY_TEST_NAME = "dns.unfriendly";
static std::string BASE_LOCATION_BUCKET_TEST_NAME = "locbuckettest";
static std::string BASE_OBJECTS_BUCKET_NAME = "objecttest";
static std::string BASE_OBJECTS_DEFAULT_CTOR_BUCKET_NAME = "ctortest";
static std::string BASE_PUT_OBJECTS_BUCKET_NAME = "putobjecttest";
static std::string BASE_PUT_WEIRD_CHARSETS_OBJECTS_BUCKET_NAME = "charsetstest";
static std::string BASE_PUT_OBJECTS_PRESIGNED_URLS_BUCKET_NAME = "presignedtest";
static std::string BASE_PUT_MULTIPART_BUCKET_NAME = "multiparttest";
static std::string BASE_ERRORS_TESTING_BUCKET = "errorstest";
static std::string BASE_EVENT_STREAM_TEST_BUCKET_NAME = "eventstream";
static std::string BASE_EVENT_STREAM_LARGE_FILE_TEST_BUCKET_NAME = "largeeventstream";
static std::string BASE_EVENT_STREAM_ERRORS_IN_EVENT_TEST_BUCKET_NAME = "errorsinevent";
static std::string BASE_CHECKSUMS_BUCKET_NAME = "checksums-crt";
static const char* ALLOCATION_TAG = "BucketAndObjectOperationTest";
static const char* TEST_OBJ_KEY = "TestObjectKey";
static const char* TEST_NOT_MODIFIED_OBJ_KEY = "TestNotModifiedObjectKey";
Expand All @@ -90,7 +90,7 @@ namespace

static const int TIMEOUT_MAX = 20;

void AppendUUID(Aws::String& bucketName)
void AppendUUID(std::string& bucketName)
{
using Aws::Utils::UUID;
Aws::StringStream s;
Expand All @@ -100,7 +100,7 @@ namespace

void EnsureUniqueBucketNames()
{
Aws::Vector<std::reference_wrapper<Aws::String>> TEST_BUCKETS =
Aws::Vector<std::reference_wrapper<std::string>> TEST_BUCKETS =
{
std::ref(BASE_CREATE_BUCKET_TEST_NAME),
std::ref(BASE_DNS_UNFRIENDLY_TEST_NAME),
Expand All @@ -121,7 +121,7 @@ namespace
for (auto& testBucketName : TEST_BUCKETS)
{
AppendUUID(testBucketName);
SCOPED_TRACE(Aws::String("EnsureUniqueBucketNames: ") + testBucketName.get());
SCOPED_TRACE(Aws::String("EnsureUniqueBucketNames: ") + testBucketName.get().c_str());
}
}

Expand Down Expand Up @@ -621,7 +621,7 @@ namespace
//Create Client with default constructor
Client = Aws::MakeShared<S3CrtClient>(ALLOCATION_TAG);

const Aws::String fullBucketName = CalculateBucketName(BASE_OBJECTS_DEFAULT_CTOR_BUCKET_NAME);
const Aws::String fullBucketName = CalculateBucketName(BASE_OBJECTS_DEFAULT_CTOR_BUCKET_NAME.c_str());
SCOPED_TRACE(Aws::String("FullBucketName ") + fullBucketName);
CreateBucketRequest createBucketRequest;
createBucketRequest.SetBucket(fullBucketName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ namespace
ASSERT_NE(S3Errors::VALIDATION, getObjectOutcome.GetError().GetErrorType());
Aws::StringStream ss;
ss << "https://" << expectedEndpoint << "/fakeObjectKey";
if (ss.str() != TestingMonitoringMetrics::s_lastUriString) {
if (ss.str() != TestingMonitoringMetrics::s_lastUriString.c_str()) {
std::cout << "Error";
}
ASSERT_STREQ(ss.str().c_str(), TestingMonitoringMetrics::s_lastUriString.c_str());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,22 @@ struct TestingMonitoringMetrics
static bool s_enablePayload;
};

static Aws::String s_lastUriString;
static Aws::String s_lastSigningRegion;
static Aws::String s_lastSigningServiceName;
static Aws::String s_lastPayload;
static Aws::Map<Aws::String, Aws::String> s_lastRequestHeaders;
// Note: these must be std:: to avoid memory issues because they are used outside InitAPI {...} ShutdownAPI.
static std::string s_lastUriString;
static std::string s_lastSigningRegion;
static std::string s_lastSigningServiceName;
static std::string s_lastPayload;
static std::map<std::string, std::string> s_lastRequestHeaders;
};

bool TestingMonitoringMetrics::Config::s_enablePayload;

std::mutex s_lastMutex;
Aws::String TestingMonitoringMetrics::s_lastUriString;
Aws::String TestingMonitoringMetrics::s_lastSigningRegion;
Aws::String TestingMonitoringMetrics::s_lastSigningServiceName;
Aws::String TestingMonitoringMetrics::s_lastPayload;
Aws::Map<Aws::String, Aws::String> TestingMonitoringMetrics::s_lastRequestHeaders;
std::string TestingMonitoringMetrics::s_lastUriString;
std::string TestingMonitoringMetrics::s_lastSigningRegion;
std::string TestingMonitoringMetrics::s_lastSigningServiceName;
std::string TestingMonitoringMetrics::s_lastPayload;
std::map<std::string, std::string> TestingMonitoringMetrics::s_lastRequestHeaders;

class TestingMonitoring : public Aws::Monitoring::MonitoringInterface
{
Expand Down Expand Up @@ -82,8 +83,6 @@ class TestingMonitoring : public Aws::Monitoring::MonitoringInterface
AWS_UNREFERENCED_PARAM(serviceName);
AWS_UNREFERENCED_PARAM(requestName);
AWS_UNREFERENCED_PARAM(context);
std::unique_lock<std::mutex> locker(s_lastMutex);

TestingMonitoringMetrics::s_lastUriString = request->GetUri().GetURIString().c_str();
TestingMonitoringMetrics::s_lastSigningRegion = request->GetSigningRegion().c_str();
Aws::Vector<Aws::String> authComponents = request->HasAwsAuthorization() ?
Expand Down Expand Up @@ -156,7 +155,6 @@ class TestingMonitoringManager
private:
static void Init()
{
std::unique_lock<std::mutex> locker(s_lastMutex);
TestingMonitoringMetrics::Config::s_enablePayload = false;

TestingMonitoringMetrics::s_lastUriString = "";
Expand Down

0 comments on commit 9754f3e

Please sign in to comment.