This is an automated email from the ASF dual-hosted git repository.
yiguolei 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 5191b4f473 [fix](ut)support run be-ut on release mode (#18119)
5191b4f473 is described below
commit 5191b4f473fbecc3fd348988e4dda58bc91fb6ec
Author: zclllyybb <[email protected]>
AuthorDate: Mon Mar 27 23:00:03 2023 +0800
[fix](ut)support run be-ut on release mode (#18119)
Fixed improper usage. So now be ut could be run on release mode.
btw, split be build type environment variable to be/be-ut.
---
be/test/olap/primary_key_index_test.cpp | 8 ++++----
be/test/runtime/test_env.cc | 7 +++----
be/test/testutil/desc_tbl_builder.cc | 4 +++-
be/test/util/threadpool_test.cpp | 4 +++-
be/test/vec/utils/arrow_column_to_doris_column_test.cpp | 2 +-
run-be-ut.sh | 2 +-
6 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/be/test/olap/primary_key_index_test.cpp
b/be/test/olap/primary_key_index_test.cpp
index 442a004603..a739dfcaf7 100644
--- a/be/test/olap/primary_key_index_test.cpp
+++ b/be/test/olap/primary_key_index_test.cpp
@@ -134,18 +134,18 @@ TEST_F(PrimaryKeyIndexTest, builder) {
MemPool pool;
while (remaining > 0) {
std::unique_ptr<segment_v2::IndexedColumnIterator> iter;
- DCHECK(index_reader.new_iterator(&iter).ok());
+ EXPECT_TRUE(index_reader.new_iterator(&iter).ok());
size_t num_to_read = std::min(batch_size, remaining);
auto index_type =
vectorized::DataTypeFactory::instance().create_data_type(
index_reader.type_info()->type(), 1, 0);
auto index_column = index_type->create_column();
Slice last_key_slice(last_key);
- DCHECK(iter->seek_at_or_after(&last_key_slice, &exact_match).ok());
+ EXPECT_TRUE(iter->seek_at_or_after(&last_key_slice,
&exact_match).ok());
size_t num_read = num_to_read;
- DCHECK(iter->next_batch(&num_read, index_column).ok());
- DCHECK(num_to_read == num_read);
+ EXPECT_TRUE(iter->next_batch(&num_read, index_column).ok());
+ EXPECT_EQ(num_to_read, num_read);
last_key = index_column->get_data_at(num_read - 1).to_string();
// exclude last_key, last_key will be read in next batch.
if (num_read == batch_size && num_read != remaining) {
diff --git a/be/test/runtime/test_env.cc b/be/test/runtime/test_env.cc
index 4551dfb330..0f3a440e7b 100644
--- a/be/test/runtime/test_env.cc
+++ b/be/test/runtime/test_env.cc
@@ -17,15 +17,14 @@
#include "runtime/test_env.h"
+#include <gtest/gtest.h>
#include <sys/stat.h>
#include <memory>
#include "olap/storage_engine.h"
-#include "runtime/fragment_mgr.h"
#include "runtime/result_queue_mgr.h"
#include "util/disk_info.h"
-#include "util/priority_thread_pool.hpp"
namespace doris {
@@ -43,7 +42,7 @@ void TestEnv::init_tmp_file_mgr(const
std::vector<std::string>& tmp_dirs, bool o
DiskInfo::init();
// will use DiskInfo::num_disks(), DiskInfo should be initialized before
auto st = _tmp_file_mgr->init_custom(tmp_dirs, one_dir_per_device);
- DCHECK(st.ok()) << st;
+ EXPECT_TRUE(st.ok());
}
TestEnv::~TestEnv() {
@@ -97,7 +96,7 @@ void TestEnv::init_storage_engine(bool need_open, const
std::vector<std::string>
} else {
_engine = new StorageEngine(options);
}
- DCHECK(st.ok()) << st;
+ EXPECT_TRUE(st.ok());
_exec_env->set_storage_engine(_engine);
}
diff --git a/be/test/testutil/desc_tbl_builder.cc
b/be/test/testutil/desc_tbl_builder.cc
index 86602cac6b..a03a87b0d6 100644
--- a/be/test/testutil/desc_tbl_builder.cc
+++ b/be/test/testutil/desc_tbl_builder.cc
@@ -17,6 +17,8 @@
#include "testutil/desc_tbl_builder.h"
+#include <gtest/gtest.h>
+
#include <vector>
#include "runtime/descriptors.h"
@@ -75,7 +77,7 @@ DescriptorTbl* DescriptorTblBuilder::build() {
}
Status status = DescriptorTbl::create(_obj_pool, thrift_desc_tbl,
&desc_tbl);
- DCHECK(status.ok());
+ EXPECT_TRUE(status.ok());
return desc_tbl;
}
diff --git a/be/test/util/threadpool_test.cpp b/be/test/util/threadpool_test.cpp
index 955f3a45ee..d268db2b92 100644
--- a/be/test/util/threadpool_test.cpp
+++ b/be/test/util/threadpool_test.cpp
@@ -327,7 +327,9 @@ TEST_F(ThreadPoolTest, TestZeroQueueSize) {
#ifndef THREAD_SANITIZER
TEST_F(ThreadPoolTest, TestDeadlocks) {
::testing::FLAGS_gtest_death_test_style = "threadsafe";
-#ifdef __APPLE__
+#ifdef NDEBUG
+ const char* death_msg =
"doris::ThreadPool::check_not_pool_thread_unlocked()";
+#elif defined(__APPLE__)
const char* death_msg =
"_ZNSt3__1L8__invokeIRNS_6__bindIMN5doris10ThreadPoolEFvvEJPS3_EEEJEEEDTclscT_fp_"
"spscT0_fp0_EEOS9_DpOSA_|_ZNSt3__18__invokeB6v15007IRNS_6__"
diff --git a/be/test/vec/utils/arrow_column_to_doris_column_test.cpp
b/be/test/vec/utils/arrow_column_to_doris_column_test.cpp
index f16558ae86..807d8d1c11 100644
--- a/be/test/vec/utils/arrow_column_to_doris_column_test.cpp
+++ b/be/test/vec/utils/arrow_column_to_doris_column_test.cpp
@@ -618,7 +618,7 @@ std::shared_ptr<arrow::Array>
create_array_array(std::vector<ColumnArray::Offset
size_t& counter) {
using offset_type = typename arrow::ListType::offset_type;
size_t num_rows = vec_offsets.size() - 1;
- DCHECK(null_map.size() == num_rows);
+ EXPECT_EQ(null_map.size(), num_rows);
size_t offsets_bytes = (vec_offsets.size()) * sizeof(offset_type);
auto offsets_buf_tmp = arrow::AllocateBuffer(offsets_bytes);
std::shared_ptr<arrow::Buffer> offsets_buf =
std::move(offsets_buf_tmp.ValueOrDie());
diff --git a/run-be-ut.sh b/run-be-ut.sh
index 18e9d078b7..efdd0afc79 100755
--- a/run-be-ut.sh
+++ b/run-be-ut.sh
@@ -123,7 +123,7 @@ if [[ -z "${PARALLEL}" ]]; then
PARALLEL="$(($(nproc) / 5 + 1))"
fi
-CMAKE_BUILD_TYPE="${BUILD_TYPE:-ASAN}"
+CMAKE_BUILD_TYPE="${BUILD_TYPE_UT:-ASAN}"
CMAKE_BUILD_TYPE="$(echo "${CMAKE_BUILD_TYPE}" | awk '{ print(toupper($0)) }')"
echo "Get params:
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]