[fix](workflow) Fix failure test cases in BE UT (macOS) (#26425)
1. Fix memory issues in LoadStreamMgrTest. 2. Skip S3FileWriterTest by default because it depends on the environment in teamcity. 3. Fix VTimestampFunctionsTest.convert_tz_test.
This commit is contained in:
@ -45,6 +45,9 @@ static std::shared_ptr<io::S3FileSystem> s3_fs {nullptr};
|
||||
class S3FileWriterTest : public testing::Test {
|
||||
public:
|
||||
static void SetUpTestSuite() {
|
||||
if (getenv(RUN_S3_TESTS) == nullptr || std::string {getenv(RUN_S3_TESTS)} != "true") {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
S3Conf s3_conf;
|
||||
config::enable_debug_points = true;
|
||||
DebugPoints::instance()->clear();
|
||||
@ -73,13 +76,23 @@ public:
|
||||
}
|
||||
|
||||
static void TearDownTestSuite() {
|
||||
if (getenv(RUN_S3_TESTS) == nullptr || std::string {getenv(RUN_S3_TESTS)} != "true") {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
ExecEnv::GetInstance()->_s3_file_upload_thread_pool->shutdown();
|
||||
ExecEnv::GetInstance()->_s3_file_upload_thread_pool = nullptr;
|
||||
delete ExecEnv::GetInstance()->_s3_buffer_pool;
|
||||
ExecEnv::GetInstance()->_s3_buffer_pool = nullptr;
|
||||
}
|
||||
|
||||
void SetUp() override {
|
||||
if (getenv(RUN_S3_TESTS) == nullptr || std::string {getenv(RUN_S3_TESTS)} != "true") {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
static constexpr char RUN_S3_TESTS[] = "RUN_S3_TESTS";
|
||||
};
|
||||
|
||||
TEST_F(S3FileWriterTest, multi_part_io_error) {
|
||||
@ -476,4 +489,4 @@ TEST_F(S3FileWriterTest, multi_part_complete_error_3) {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace doris
|
||||
} // namespace doris
|
||||
|
||||
@ -613,12 +613,11 @@ public:
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
ExecEnv::GetInstance()->set_storage_engine(nullptr);
|
||||
k_engine.reset();
|
||||
_server->Stop(1000);
|
||||
_load_stream_mgr.reset();
|
||||
CHECK_EQ(0, _server->Join());
|
||||
SAFE_DELETE(_server);
|
||||
k_engine.reset();
|
||||
doris::ExecEnv::GetInstance()->set_storage_engine(nullptr);
|
||||
}
|
||||
|
||||
std::string read_data(int64_t txn_id, int64_t partition_id, int64_t tablet_id, uint32_t segid) {
|
||||
|
||||
@ -209,7 +209,13 @@ TEST(VTimestampFunctionsTest, convert_tz_test) {
|
||||
|
||||
InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::String, TypeIndex::String};
|
||||
|
||||
{
|
||||
bool case_sensitive = true;
|
||||
cctz::time_zone tz {};
|
||||
if (TimezoneUtils::find_cctz_time_zone("Asia/SHANGHAI", tz)) {
|
||||
case_sensitive = false;
|
||||
}
|
||||
|
||||
if (case_sensitive) {
|
||||
DataSet data_set = {{{std::string {"2019-08-01 02:18:27"}, std::string {"Asia/SHANGHAI"},
|
||||
std::string {"america/Los_angeles"}},
|
||||
Null()}};
|
||||
@ -221,15 +227,18 @@ TEST(VTimestampFunctionsTest, convert_tz_test) {
|
||||
DataSet data_set = {{{std::string {"2019-08-01 02:18:27"}, std::string {"Asia/Shanghai"},
|
||||
std::string {"UTC"}},
|
||||
str_to_datetime_v2("2019-07-31 18:18:27", "%Y-%m-%d %H:%i:%s.%f")},
|
||||
{{std::string {"2019-08-01 02:18:27"}, std::string {"Asia/Shanghai"},
|
||||
std::string {"Utc"}},
|
||||
Null()},
|
||||
{{std::string {"2019-08-01 02:18:27"}, std::string {"Asia/Shanghai"},
|
||||
std::string {"UTC"}},
|
||||
str_to_datetime_v2("2019-07-31 18:18:27", "%Y-%m-%d %H:%i:%s.%f")},
|
||||
{{std::string {"2019-08-01 02:18:27"}, std::string {"Asia/SHANGHAI"},
|
||||
std::string {"america/Los_angeles"}},
|
||||
Null()}};
|
||||
str_to_datetime_v2("2019-07-31 18:18:27", "%Y-%m-%d %H:%i:%s.%f")}};
|
||||
if (case_sensitive) {
|
||||
data_set.push_back(Row {{std::string {"2019-08-01 02:18:27"},
|
||||
std::string {"Asia/Shanghai"}, std::string {"Utc"}},
|
||||
Null()});
|
||||
data_set.push_back(
|
||||
Row {{std::string {"2019-08-01 02:18:27"}, std::string {"Asia/SHANGHAI"},
|
||||
std::string {"america/Los_angeles"}},
|
||||
Null()});
|
||||
}
|
||||
static_cast<void>(
|
||||
check_function<DataTypeDateTimeV2, true>(func_name, input_types, data_set, false));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user