Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/milvus-io/milvus into 240…
Browse files Browse the repository at this point in the history
…8-skip-bf
  • Loading branch information
bigsheeper committed Sep 2, 2024
2 parents f795e55 + b2eb9fe commit 00ff9f2
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion internal/core/unittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ endif()
if (LINUX)
message( STATUS "Building Milvus Unit Test on Linux")
option(USE_ASAN "Whether to use AddressSanitizer" OFF)
if ( USE_ASAN AND false )
if ( USE_ASAN )
message( STATUS "Building Milvus using AddressSanitizer")
add_compile_options(-fno-stack-protector -fno-omit-frame-pointer -fno-var-tracking -fsanitize=address)
add_link_options(-fno-stack-protector -fno-omit-frame-pointer -fno-var-tracking -fsanitize=address)
Expand Down
5 changes: 5 additions & 0 deletions internal/core/unittest/test_c_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "segcore/reduce_c.h"
#include "segcore/segment_c.h"
#include "futures/Future.h"
#include "futures/future_c.h"
#include "test_utils/DataGen.h"
#include "test_utils/PbHelper.h"
#include "test_utils/indexbuilder_test_utils.h"
Expand Down Expand Up @@ -79,6 +80,8 @@ CRetrieve(CSegmentInterface c_segment,
mu.lock();

auto [retrieveResult, status] = futurePtr->leakyGet();
future_destroy(future);

if (status.error_code != 0) {
return status;
}
Expand All @@ -104,6 +107,8 @@ CRetrieveByOffsets(CSegmentInterface c_segment,
mu.lock();

auto [retrieveResult, status] = futurePtr->leakyGet();
future_destroy(future);

if (status.error_code != 0) {
return status;
}
Expand Down
6 changes: 3 additions & 3 deletions internal/core/unittest/test_data_codec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,8 @@ TEST(storage, InsertDataFloatNullable) {
FixedVector<float> data = {1, 2, 3, 4, 5};
auto field_data =
milvus::storage::CreateFieldData(storage::DataType::FLOAT, true);
uint8_t* valid_data = new uint8_t[1]{0x13};
field_data->FillFieldData(data.data(), valid_data, data.size());
std::array<uint8_t, 1> valid_data = {0x13};
field_data->FillFieldData(data.data(), valid_data.data(), data.size());

storage::InsertData insert_data(field_data);
storage::FieldDataMeta field_data_meta{100, 101, 102, 103};
Expand All @@ -457,7 +457,7 @@ TEST(storage, InsertDataFloatNullable) {
data = {1, 2, 0, 0, 5};
ASSERT_EQ(data, new_data);
ASSERT_EQ(new_payload->get_null_count(), 2);
ASSERT_EQ(*new_payload->ValidData(), *valid_data);
ASSERT_EQ(*new_payload->ValidData(), valid_data[0]);
}

TEST(storage, InsertDataDouble) {
Expand Down
8 changes: 4 additions & 4 deletions internal/core/unittest/test_sealed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2015,12 +2015,12 @@ TEST(Sealed, SkipIndexSkipUnaryRangeNullable) {

//test for int64
std::vector<int64_t> int64s = {1, 2, 3, 4, 5};
uint8_t* valid_data = new uint8_t[1]{0x03};
std::array<uint8_t, 1> valid_data = {0x03};
FixedVector<bool> valid_data_ = {true, true, false, false, false};
auto int64s_field_data =
storage::CreateFieldData(DataType::INT64, true, 1, 5);

int64s_field_data->FillFieldData(int64s.data(), valid_data, 5);
int64s_field_data->FillFieldData(int64s.data(), valid_data.data(), 5);
segment->LoadPrimitiveSkipIndex(i64_fid,
0,
DataType::INT64,
Expand Down Expand Up @@ -2084,12 +2084,12 @@ TEST(Sealed, SkipIndexSkipBinaryRangeNullable) {

//test for int64
std::vector<int64_t> int64s = {1, 2, 3, 4, 5};
uint8_t* valid_data = new uint8_t[1]{0x03};
std::array<uint8_t, 1> valid_data = {0x03};
FixedVector<bool> valid_data_ = {true, true, false, false, false};
auto int64s_field_data =
storage::CreateFieldData(DataType::INT64, true, 1, 5);

int64s_field_data->FillFieldData(int64s.data(), valid_data, 5);
int64s_field_data->FillFieldData(int64s.data(), valid_data.data(), 5);
segment->LoadPrimitiveSkipIndex(i64_fid,
0,
DataType::INT64,
Expand Down
3 changes: 3 additions & 0 deletions internal/core/unittest/test_utils/c_api_test_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "segcore/reduce_c.h"
#include "segcore/segment_c.h"
#include "futures/Future.h"
#include "futures/future_c.h"
#include "DataGen.h"
#include "PbHelper.h"
#include "c_api_test_utils.h"
Expand Down Expand Up @@ -193,6 +194,8 @@ CSearch(CSegmentInterface c_segment,
mu.lock();

auto [searchResult, status] = futurePtr->leakyGet();
future_destroy(future);

if (status.error_code != 0) {
return status;
}
Expand Down

0 comments on commit 00ff9f2

Please sign in to comment.