add test, add comment

This commit is contained in:
Sema Checherinda 2023-06-25 13:27:07 +02:00
parent 80aa8863e5
commit 79a03432bf
3 changed files with 34 additions and 1 deletions

View File

@ -192,7 +192,10 @@ public:
};
/// This wrapper helps to avoid too noisy log messages from similar objects.
/// For the value logger_name it remembers when such a message was logged the last time.
/// Once an instance of LogSeriesLimiter type is created the decision is done
/// All followed message which use this instance is either printed or muted all together.
/// LogSeriesLimiter differs from LogFrequencyLimiterIml in a way that
/// LogSeriesLimiter is useful for accept or mute series of logs when LogFrequencyLimiterIml works for each line independently.
class LogSeriesLimiter
{
static std::mutex mutex;

View File

@ -417,6 +417,8 @@ private:
{
SentryWriter::onFault(sig, error_message, stack_trace);
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunreachable-code"
/// Advice the user to send it manually.
if constexpr (std::string_view(VERSION_OFFICIAL).contains("official build"))
{

View File

@ -1119,4 +1119,32 @@ TEST_P(SyncAsync, IncreaseLimited) {
}
}
TEST_P(SyncAsync, StrictUploadPartSize) {
getSettings().s3_check_objects_after_upload = false;
{
getSettings().s3_max_single_part_upload_size = 10;
getSettings().s3_strict_upload_part_size = 11;
{
auto counters = MockS3::EventCounts{.multiUploadCreate = 1, .multiUploadComplete = 1, .uploadParts = 6};
runSimpleScenario(counters, 66);
auto actual_parts_sizes = MockS3::BucketMemStore::GetPartSizes(getCompletedPartUploads().back().second);
ASSERT_THAT(actual_parts_sizes, testing::ElementsAre(11, 11, 11, 11, 11, 11));
// parts: 11 22 33 44 55 66
// size: 11 11 11 11 11 11
}
{
auto counters = MockS3::EventCounts{.multiUploadCreate = 1, .multiUploadComplete = 1, .uploadParts = 7};
runSimpleScenario(counters, 67);
auto actual_parts_sizes = MockS3::BucketMemStore::GetPartSizes(getCompletedPartUploads().back().second);
ASSERT_THAT(actual_parts_sizes, testing::ElementsAre(11, 11, 11, 11, 11, 11, 1));
}
}
}
#endif