You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by ad...@apache.org on 2023/11/06 02:44:51 UTC
(doris) branch master updated: [fix](workflow) Fix failure test cases in BE UT (macOS) (#26425)
This is an automated email from the ASF dual-hosted git repository.
adonisling pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 1e2a614a46e [fix](workflow) Fix failure test cases in BE UT (macOS) (#26425)
1e2a614a46e is described below
commit 1e2a614a46e6bee103ffc35c7becf2bd9d930fe2
Author: Adonis Ling <ad...@gmail.com>
AuthorDate: Mon Nov 6 10:44:44 2023 +0800
[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.
---
be/test/io/fs/s3_file_writer_test.cpp | 15 ++++++++++++++-
be/test/runtime/load_stream_test.cpp | 5 ++---
be/test/vec/function/function_time_test.cpp | 25 +++++++++++++++++--------
3 files changed, 33 insertions(+), 12 deletions(-)
diff --git a/be/test/io/fs/s3_file_writer_test.cpp b/be/test/io/fs/s3_file_writer_test.cpp
index a1df6a1ea8b..b37d358f657 100644
--- a/be/test/io/fs/s3_file_writer_test.cpp
+++ b/be/test/io/fs/s3_file_writer_test.cpp
@@ -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
\ No newline at end of file
+} // namespace doris
diff --git a/be/test/runtime/load_stream_test.cpp b/be/test/runtime/load_stream_test.cpp
index c733d787222..17c8b3707ae 100644
--- a/be/test/runtime/load_stream_test.cpp
+++ b/be/test/runtime/load_stream_test.cpp
@@ -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) {
diff --git a/be/test/vec/function/function_time_test.cpp b/be/test/vec/function/function_time_test.cpp
index 85b692a4708..d02fea35bc3 100644
--- a/be/test/vec/function/function_time_test.cpp
+++ b/be/test/vec/function/function_time_test.cpp
@@ -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));
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org