Skip to content

Commit

Permalink
CI should be green - part1
Browse files Browse the repository at this point in the history
  • Loading branch information
robertbindar committed Sep 16, 2022
1 parent 500737b commit 45840e3
Show file tree
Hide file tree
Showing 8 changed files with 207 additions and 105 deletions.
2 changes: 2 additions & 0 deletions test/src/unit-capi-nullable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ NullableArrayFx::NullableArrayFx() {
REQUIRE(tiledb_vfs_alloc(ctx_, config, &vfs_) == TILEDB_OK);

tiledb_config_free(&config);

serialized_writes = false;
}

NullableArrayFx::~NullableArrayFx() {
Expand Down
2 changes: 2 additions & 0 deletions test/src/unit-capi-sparse_heter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,9 @@ TEST_CASE_METHOD(
serialize_ = false;
}
SECTION("- Serialization") {
#ifdef TILEDB_SERIALIZATION
serialize_ = true;
#endif
}

SupportedFsLocal local_fs;
Expand Down
100 changes: 72 additions & 28 deletions test/src/unit-capi-string_dims.cc
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ void StringDimsFx::write_array_1d(
rc = tiledb_query_set_layout(ctx, query, layout);
REQUIRE(rc == TILEDB_OK);
if (layout != TILEDB_GLOBAL_ORDER || !serialize_) {
rc = tiledb_query_submit_wrapper(ctx, query, array_name);
rc = tiledb_query_submit(ctx, query);
REQUIRE(rc == TILEDB_OK);
rc = tiledb_query_finalize(ctx, query);
REQUIRE(rc == TILEDB_OK);
Expand Down Expand Up @@ -691,10 +691,14 @@ void StringDimsFx::write_array_2d(
REQUIRE(rc == TILEDB_OK);
rc = tiledb_query_set_layout(ctx, query, layout);
REQUIRE(rc == TILEDB_OK);
rc = tiledb_query_submit_wrapper(ctx, query, array_name);
REQUIRE(rc == TILEDB_OK);
rc = tiledb_query_finalize(ctx, query);
REQUIRE(rc == TILEDB_OK);
if (layout != TILEDB_GLOBAL_ORDER || !serialize_) {
rc = tiledb_query_submit(ctx, query);
REQUIRE(rc == TILEDB_OK);
rc = tiledb_query_finalize(ctx, query);
REQUIRE(rc == TILEDB_OK);
} else {
submit_and_finalize_serialized_query(ctx, query);
}

// Close array
rc = tiledb_array_close(ctx, array);
Expand Down Expand Up @@ -1148,7 +1152,6 @@ void StringDimsFx::read_array_2d_default_string_range(
rc = tiledb_query_set_layout(ctx, query, layout);
REQUIRE(rc == TILEDB_OK);

// Submit query
const char* array_uri;
rc = tiledb_array_get_uri(ctx, array, &array_uri);
CHECK(rc == TILEDB_OK);
Expand Down Expand Up @@ -1177,7 +1180,9 @@ TEST_CASE_METHOD(
serialize_ = false;
}
SECTION("- Serialization") {
#ifdef TILEDB_SERIALIZATION
serialize_ = true;
#endif
}
SupportedFsLocal local_fs;
std::string array_name =
Expand Down Expand Up @@ -1285,7 +1290,9 @@ TEST_CASE_METHOD(
serialize_ = false;
}
SECTION("- Serialization") {
#ifdef TILEDB_SERIALIZATION
serialize_ = true;
#endif
}
SupportedFsLocal local_fs;
std::string array_name =
Expand Down Expand Up @@ -1358,7 +1365,9 @@ TEST_CASE_METHOD(
serialize_ = false;
}
SECTION("- Serialization") {
#ifdef TILEDB_SERIALIZATION
serialize_ = true;
#endif
}
SupportedFsLocal local_fs;
std::string array_name =
Expand Down Expand Up @@ -1432,7 +1441,9 @@ TEST_CASE_METHOD(
serialize_ = false;
}
SECTION("- Serialization") {
#ifdef TILEDB_SERIALIZATION
serialize_ = true;
#endif
}
SupportedFsLocal local_fs;
std::string array_name =
Expand Down Expand Up @@ -1505,7 +1516,9 @@ TEST_CASE_METHOD(
serialize_ = false;
}
SECTION("- Serialization") {
#ifdef TILEDB_SERIALIZATION
serialize_ = true;
#endif
}
SupportedFsLocal local_fs;
std::string array_name =
Expand Down Expand Up @@ -1624,7 +1637,9 @@ TEST_CASE_METHOD(
serialize_ = false;
}
SECTION("- Serialization") {
#ifdef TILEDB_SERIALIZATION
serialize_ = true;
#endif
}
SupportedFsLocal local_fs;
std::string array_name =
Expand Down Expand Up @@ -1863,7 +1878,9 @@ TEST_CASE_METHOD(
serialize_ = false;
}
SECTION("- Serialization") {
#ifdef TILEDB_SERIALIZATION
serialize_ = true;
#endif
}
SupportedFsLocal local_fs;
std::string array_name =
Expand Down Expand Up @@ -2050,7 +2067,9 @@ TEST_CASE_METHOD(
serialize_ = false;
}
SECTION("- Serialization") {
#ifdef TILEDB_SERIALIZATION
serialize_ = true;
#endif
}
SupportedFsLocal local_fs;
std::string array_name =
Expand Down Expand Up @@ -2161,7 +2180,9 @@ TEST_CASE_METHOD(
serialize_ = false;
}
SECTION("- Serialization") {
#ifdef TILEDB_SERIALIZATION
serialize_ = true;
#endif
}
SupportedFsLocal local_fs;
std::string array_name =
Expand Down Expand Up @@ -2289,7 +2310,9 @@ TEST_CASE_METHOD(
serialize_ = false;
}
SECTION("- Serialization") {
#ifdef TILEDB_SERIALIZATION
serialize_ = true;
#endif
}
SupportedFsLocal local_fs;
std::string array_name =
Expand Down Expand Up @@ -2551,7 +2574,9 @@ TEST_CASE_METHOD(
serialize_ = false;
}
SECTION("- Serialization") {
#ifdef TILEDB_SERIALIZATION
serialize_ = true;
#endif
}
SupportedFsLocal local_fs;
std::string array_name =
Expand All @@ -2572,7 +2597,7 @@ TEST_CASE_METHOD(
{tiledb::test::Compressor(TILEDB_FILTER_NONE, -1)},
TILEDB_ROW_MAJOR,
TILEDB_ROW_MAJOR,
3,
1,
false,
false);

Expand Down Expand Up @@ -2602,19 +2627,24 @@ TEST_CASE_METHOD(
REQUIRE(rc == TILEDB_OK);
rc = tiledb_query_set_layout(ctx_, query, TILEDB_GLOBAL_ORDER);
REQUIRE(rc == TILEDB_OK);
// rc = tiledb_query_submit_wrapper(ctx_, query, array_name);
// REQUIRE(rc == TILEDB_OK);
tiledb_query_submit_and_finalize(ctx_, query);

if (serialize_) {
submit_serialized_query(ctx_, query);
} else {
rc = tiledb_query_submit(ctx_, query);
REQUIRE(rc == TILEDB_OK);
}
// Write "b, 2"
d_data[0] = 'b';
a_data[0] = 2;
// rc = tiledb_query_submit_wrapper(ctx_, query, array_name);
// REQUIRE(rc == TILEDB_OK);

// rc = tiledb_query_finalize(ctx_, query);
// REQUIRE(rc == TILEDB_OK);
tiledb_query_submit_and_finalize(ctx_, query);
if (serialize_) {
submit_and_finalize_serialized_query(ctx_, query);
} else {
rc = tiledb_query_submit(ctx_, query);
REQUIRE(rc == TILEDB_OK);
rc = tiledb_query_finalize(ctx_, query);
CHECK(rc == TILEDB_OK);
}

// Close array
rc = tiledb_array_close(ctx_, array);
Expand Down Expand Up @@ -2671,7 +2701,9 @@ TEST_CASE_METHOD(
serialize_ = false;
}
SECTION("- Serialization") {
#ifdef TILEDB_SERIALIZATION
serialize_ = true;
#endif
}
SupportedFsLocal local_fs;
std::string array_name =
Expand All @@ -2692,7 +2724,7 @@ TEST_CASE_METHOD(
{tiledb::test::Compressor(TILEDB_FILTER_NONE, -1)},
TILEDB_ROW_MAJOR,
TILEDB_ROW_MAJOR,
3,
1,
false,
false);

Expand Down Expand Up @@ -2722,16 +2754,23 @@ TEST_CASE_METHOD(
REQUIRE(rc == TILEDB_OK);
rc = tiledb_query_set_layout(ctx_, query, TILEDB_GLOBAL_ORDER);
REQUIRE(rc == TILEDB_OK);
// rc = tiledb_query_submit_wrapper(ctx_, query, array_name);
// REQUIRE(rc == TILEDB_OK);
tiledb_query_submit_and_finalize(ctx_, query);

if (serialize_) {
submit_serialized_query(ctx_, query);
} else {
rc = tiledb_query_submit(ctx_, query);
REQUIRE(rc == TILEDB_OK);
}
// Write "b, 2"
d_data[0] = 'b';
a_data[0] = 2;
// rc = tiledb_query_submit_wrapper(ctx_, query, array_name);
// REQUIRE(rc == TILEDB_OK);
tiledb_query_submit_and_finalize(ctx_, query);

if (serialize_) {
submit_serialized_query(ctx_, query);
} else {
rc = tiledb_query_submit(ctx_, query);
REQUIRE(rc == TILEDB_OK);
}

// Write c, 3; d, 4 and e, 5.
d_data[0] = 'c';
Expand All @@ -2743,12 +2782,15 @@ TEST_CASE_METHOD(
a_data[1] = 4;
a_data[2] = 5;
a_size = 3 * sizeof(int32_t);
// rc = tiledb_query_submit_wrapper(ctx_, query, array_name);
// REQUIRE(rc == TILEDB_OK);

// rc = tiledb_query_finalize(ctx_, query);
// REQUIRE(rc == TILEDB_OK);
tiledb_query_submit_and_finalize(ctx_, query);
if (serialize_) {
submit_and_finalize_serialized_query(ctx_, query);
} else {
rc = tiledb_query_submit(ctx_, query);
REQUIRE(rc == TILEDB_OK);
rc = tiledb_query_finalize(ctx_, query);
CHECK(rc == TILEDB_OK);
}

// Close array
rc = tiledb_array_close(ctx_, array);
Expand Down Expand Up @@ -2805,7 +2847,9 @@ TEST_CASE_METHOD(
serialize_ = false;
}
SECTION("- Serialization") {
#ifdef TILEDB_SERIALIZATION
serialize_ = true;
#endif
}
SupportedFsLocal local_fs;
std::string array_name =
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-cppapi-consolidation-with-timestamps.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ struct ConsolidationWithTimestampsFx {
void remove_sparse_array();
void remove_array(const std::string& array_name);
bool is_array(const std::string& array_name);
bool serialized_writes;
bool serialized_writes = false;
};

ConsolidationWithTimestampsFx::ConsolidationWithTimestampsFx()
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-cppapi-nullable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class NullableArrayCppFx {
tiledb_layout_t tile_order,
tiledb_layout_t write_order);

bool serialized_writes_;
bool serialized_writes_ = false;

private:
/** The C++ API context object. */
Expand Down
41 changes: 30 additions & 11 deletions test/src/unit-cppapi-var-offsets.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void write_sparse_array(
query.set_data_buffer("attr", data);
query.set_offsets_buffer("attr", data_offsets);

if (!serialized_writes) {
if (!serialized_writes || layout != TILEDB_GLOBAL_ORDER) {
CHECK_NOTHROW(query.submit());
query.finalize();
} else {
Expand Down Expand Up @@ -109,7 +109,7 @@ void write_sparse_array(
"attr",
reinterpret_cast<uint64_t*>(data_offsets.data()),
data_offsets.size());
if (!serialized_writes) {
if (!serialized_writes || layout != TILEDB_GLOBAL_ORDER) {
CHECK_NOTHROW(query.submit());
query.finalize();
} else {
Expand Down Expand Up @@ -299,12 +299,20 @@ void write_dense_array(
query.set_subarray<int64_t>({1, 2, 1, 2});
}

// CHECK_NOTHROW(query.submit());

// Finalize is necessary in global writes, otherwise a no-op
// query.finalize();
test::submit_serialized_query(ctx, query);
test::finalize_serialized_query(ctx, query);
SECTION("no serialization") {
serialized_writes = false;
}
SECTION("serialization enabled global order write") {
#ifdef TILEDB_SERIALIZATION
serialized_writes = true;
#endif
}
if (!serialized_writes || layout != TILEDB_GLOBAL_ORDER) {
CHECK_NOTHROW(query.submit());
query.finalize();
} else {
test::submit_and_finalize_serialized_query(ctx, query);
}

array.close();
}
Expand Down Expand Up @@ -347,9 +355,20 @@ void write_dense_array(
query.set_subarray<int64_t>({1, 2, 1, 2});
}

CHECK_NOTHROW(query.submit());
// Finalize is necessary in global writes, otherwise a no-op
query.finalize();
SECTION("no serialization") {
serialized_writes = false;
}
SECTION("serialization enabled global order write") {
#ifdef TILEDB_SERIALIZATION
serialized_writes = true;
#endif
}
if (!serialized_writes || layout != TILEDB_GLOBAL_ORDER) {
CHECK_NOTHROW(query.submit());
query.finalize();
} else {
test::submit_and_finalize_serialized_query(ctx, query);
}

array.close();
}
Expand Down
2 changes: 1 addition & 1 deletion tiledb/sm/filesystem/s3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1771,7 +1771,7 @@ std::optional<S3::MultiPartUploadState> S3::multipart_upload_state(
MultiPartUploadState rv_state = std::move(state_iter->second);
multipart_upload_states_.erase(state_iter);

return std::move(rv_state);
return rv_state;
}

Status S3::set_multipart_upload_state(
Expand Down

0 comments on commit 45840e3

Please sign in to comment.