Skip to content

Commit 1aef209

Browse files
committed
Try workaround for ASAN failures.
1 parent 01b1e9d commit 1aef209

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

test/src/unit-cppapi-consolidation-with-timestamps.cc

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -737,8 +737,10 @@ TEST_CASE_METHOD(
737737
std::vector<uint64_t> dim1(10);
738738
std::vector<uint64_t> dim2(10);
739739
std::vector<uint64_t> timestamps(10);
740-
auto timestamps_ptr =
741-
GENERATE_REF(as<std::vector<uint64_t>*>{}, nullptr, &timestamps);
740+
// We are not using GENERATE_REF(as<std::vector<uint64_t>*>{}, nullptr,
741+
// &timestamps) because of ASAN errors.
742+
bool use_timestamps = GENERATE(false, true);
743+
auto timestamps_ptr = use_timestamps ? &timestamps : nullptr;
742744

743745
SECTION("Read after all writes") {
744746
// Read after both writes - should see everything.
@@ -823,8 +825,10 @@ TEST_CASE_METHOD(
823825
std::vector<uint64_t> dim1(10);
824826
std::vector<uint64_t> dim2(10);
825827
std::vector<uint64_t> timestamps(10);
826-
auto timestamps_ptr =
827-
GENERATE_REF(as<std::vector<uint64_t>*>{}, nullptr, &timestamps);
828+
// We are not using GENERATE_REF(as<std::vector<uint64_t>*>{}, nullptr,
829+
// &timestamps) because of ASAN errors.
830+
bool use_timestamps = GENERATE(false, true);
831+
auto timestamps_ptr = use_timestamps ? &timestamps : nullptr;
828832

829833
SECTION("Read after all writes") {
830834
read_sparse(a, dim1, dim2, stats, TILEDB_GLOBAL_ORDER, 4, timestamps_ptr);
@@ -904,8 +908,10 @@ TEST_CASE_METHOD(
904908
std::vector<uint64_t> dim1(16);
905909
std::vector<uint64_t> dim2(16);
906910
std::vector<uint64_t> timestamps(16);
907-
auto timestamps_ptr =
908-
GENERATE_REF(as<std::vector<uint64_t>*>{}, nullptr, &timestamps);
911+
// We are not using GENERATE_REF(as<std::vector<uint64_t>*>{}, nullptr,
912+
// &timestamps) because of ASAN errors.
913+
bool use_timestamps = GENERATE(false, true);
914+
auto timestamps_ptr = use_timestamps ? &timestamps : nullptr;
909915

910916
SECTION("Read after all writes") {
911917
// Read after both writes - should see everything.
@@ -1043,8 +1049,10 @@ TEST_CASE_METHOD(
10431049
std::vector<uint64_t> dim1(16);
10441050
std::vector<uint64_t> dim2(16);
10451051
std::vector<uint64_t> timestamps(16);
1046-
auto timestamps_ptr =
1047-
GENERATE_REF(as<std::vector<uint64_t>*>{}, nullptr, &timestamps);
1052+
// We are not using GENERATE_REF(as<std::vector<uint64_t>*>{}, nullptr,
1053+
// &timestamps) because of ASAN errors.
1054+
bool use_timestamps = GENERATE(false, true);
1055+
auto timestamps_ptr = use_timestamps ? &timestamps : nullptr;
10481056

10491057
SECTION("Read in the middle") {
10501058
// Read between 2 and 4.
@@ -1148,8 +1156,10 @@ TEST_CASE_METHOD(
11481156
std::vector<uint64_t> dim1(16);
11491157
std::vector<uint64_t> dim2(16);
11501158
std::vector<uint64_t> timestamps(16);
1151-
auto timestamps_ptr =
1152-
GENERATE_REF(as<std::vector<uint64_t>*>{}, nullptr, &timestamps);
1159+
// We are not using GENERATE_REF(as<std::vector<uint64_t>*>{}, nullptr,
1160+
// &timestamps) because of ASAN errors.
1161+
bool use_timestamps = GENERATE(false, true);
1162+
auto timestamps_ptr = use_timestamps ? &timestamps : nullptr;
11531163

11541164
SECTION("Read in the middle") {
11551165
// Read between 2 and 4
@@ -1359,8 +1369,10 @@ TEST_CASE_METHOD(
13591369
std::vector<uint64_t> dim1(16);
13601370
std::vector<uint64_t> dim2(16);
13611371
std::vector<uint64_t> timestamps(16);
1362-
auto timestamps_ptr =
1363-
GENERATE_REF(as<std::vector<uint64_t>*>{}, nullptr, &timestamps);
1372+
// We are not using GENERATE_REF(as<std::vector<uint64_t>*>{}, nullptr,
1373+
// &timestamps) because of ASAN errors.
1374+
bool use_timestamps = GENERATE(false, true);
1375+
auto timestamps_ptr = use_timestamps ? &timestamps : nullptr;
13641376

13651377
SECTION("Read in the middle") {
13661378
// Read between 2 and 4.

0 commit comments

Comments
 (0)