Skip to content

Commit

Permalink
Various fixes to stabilize CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ypatia committed Mar 29, 2024
1 parent 6399150 commit 326314a
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 65 deletions.
14 changes: 5 additions & 9 deletions test/src/test-capi-consolidation-plan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@
using namespace tiledb;
using namespace tiledb::test;

#ifndef TILEDB_TESTS_ENABLE_REST
constexpr bool rest_tests = false;
#else
constexpr bool rest_tests = true;
#endif

struct ConsolidationPlanFx {
// Constructors/destructors.
ConsolidationPlanFx();
Expand Down Expand Up @@ -89,16 +83,18 @@ ConsolidationPlanFx::ConsolidationPlanFx()
test::vfs_test_init(fs_vec_, &ctx_c_, &vfs_c_, config.ptr().get()).ok());
ctx_ = Context(ctx_c_);
std::string temp_dir = fs_vec_[0]->temp_dir();
if constexpr (rest_tests) {
if (fs_vec_[0]->is_rest()) {
array_name_ = "tiledb://unit/";
}
array_name_ += temp_dir + "test_consolidation_plan_array";
test::vfs_test_create_temp_dir(ctx_c_, vfs_c_, temp_dir);
}

ConsolidationPlanFx::~ConsolidationPlanFx() {
Array::delete_array(ctx_, array_name_);
REQUIRE(test::vfs_test_close(fs_vec_, ctx_c_, vfs_c_).ok());
test::vfs_test_remove_temp_dir(ctx_c_, vfs_c_, fs_vec_[0]->temp_dir());
test::vfs_test_close(fs_vec_, ctx_c_, vfs_c_).ok();
tiledb_ctx_free(&ctx_c_);
tiledb_vfs_free(&vfs_c_);
}

void ConsolidationPlanFx::create_sparse_array(bool allows_dups, bool encrypt) {
Expand Down
4 changes: 3 additions & 1 deletion test/src/unit-capi-array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,9 @@ TEST_CASE_METHOD(
}

TEST_CASE_METHOD(
ArrayFx, "C API: Test array with encryption", "[capi][array][encryption]") {
ArrayFx,
"C API: Test array with encryption",
"[capi][array][encryption][non-rest]") {
// Create array schema
tiledb_array_schema_t* array_schema;
int rc = tiledb_array_schema_alloc(ctx_, TILEDB_SPARSE, &array_schema);
Expand Down
25 changes: 0 additions & 25 deletions test/src/unit-capi-dense_array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3387,7 +3387,6 @@ TEST_CASE_METHOD(

// Create and write dense array
std::string array_name = path + "with_ending_slash/";
create_temp_dir(temp_dir);
create_dense_array(array_name);
write_dense_array(array_name);
read_dense_array_with_coords_full_global(array_name, true);
Expand All @@ -3404,7 +3403,6 @@ TEST_CASE_METHOD(
fs_vec_[0]->is_rest() ? "tiledb://unit/" + temp_dir : temp_dir;

std::string array_name = path + "dense_write_missing_attributes/";
create_temp_dir(temp_dir);
create_dense_array(array_name);
write_dense_array_missing_attributes(array_name);
remove_temp_dir(temp_dir);
Expand All @@ -3420,8 +3418,6 @@ TEST_CASE_METHOD(
fs_vec_[0]->is_rest() ? "tiledb://unit/" + temp_dir : temp_dir;

std::string array_name = path + "dense_read_empty/";
create_temp_dir(temp_dir);

create_dense_array_1_attribute(array_name);

// Write a slice
Expand Down Expand Up @@ -3508,8 +3504,6 @@ TEST_CASE_METHOD(
fs_vec_[0]->is_rest() ? "tiledb://unit/" + temp_dir : temp_dir;

std::string array_name = path + "dense_read_empty_merge/";
create_temp_dir(temp_dir);

create_dense_array_1_attribute(array_name);

// Write a slice
Expand Down Expand Up @@ -3595,8 +3589,6 @@ TEST_CASE_METHOD(
fs_vec_[0]->is_rest() ? "tiledb://unit/" + temp_dir : temp_dir;

std::string array_name = path + "dense_multi_fragment/";
create_temp_dir(temp_dir);

create_dense_array_1_attribute(array_name);

// Write slice [1,2], [3,4]
Expand Down Expand Up @@ -3704,7 +3696,6 @@ TEST_CASE_METHOD(
fs_vec_[0]->is_rest() ? "tiledb://unit/" + temp_dir : temp_dir;

std::string array_name = path + "dense_is_open/";
create_temp_dir(temp_dir);
create_dense_array(array_name);

tiledb_array_t* array;
Expand Down Expand Up @@ -3745,7 +3736,6 @@ TEST_CASE_METHOD(
fs_vec_[0]->is_rest() ? "tiledb://unit/" + temp_dir : temp_dir;

std::string array_name = path + "dense_get_schema/";
create_temp_dir(temp_dir);
create_dense_array(array_name);

// Open array
Expand Down Expand Up @@ -3781,7 +3771,6 @@ TEST_CASE_METHOD(
fs_vec_[0]->is_rest() ? "tiledb://unit/" + temp_dir : temp_dir;

std::string array_name = path + "dense-col-updates";
create_temp_dir(temp_dir);
create_dense_array_1_attribute(array_name);

// ------ WRITE QUERIES ------ //
Expand Down Expand Up @@ -3933,7 +3922,6 @@ TEST_CASE_METHOD(
fs_vec_[0]->is_rest() ? "tiledb://unit/" + temp_dir : temp_dir;

std::string array_name = path + "unary-range";
create_temp_dir(temp_dir);

// Create and write dense array
create_dense_array(array_name);
Expand Down Expand Up @@ -4016,9 +4004,7 @@ TEST_CASE_METHOD(
create_temp_dir(temp_dir);
std::string path =
fs_vec_[0]->is_rest() ? "tiledb://unit/" + temp_dir : temp_dir;

std::string array_name = path + "default-dim";
create_temp_dir(temp_dir);

// Create and write dense array
create_dense_array(array_name);
Expand Down Expand Up @@ -4076,7 +4062,6 @@ TEST_CASE_METHOD(
fs_vec_[0]->is_rest() ? "tiledb://unit/" + temp_dir : temp_dir;

std::string array_name = path + "dense_read_same_tile";
create_temp_dir(temp_dir);

create_dense_array_same_tile(array_name);

Expand Down Expand Up @@ -4194,9 +4179,7 @@ TEST_CASE_METHOD(
create_temp_dir(temp_dir);
std::string path =
fs_vec_[0]->is_rest() ? "tiledb://unit/" + temp_dir : temp_dir;

std::string array_name = path + "dense_read_multi_index_simple";
create_temp_dir(temp_dir);

create_large_dense_array_1_attribute(array_name);

Expand Down Expand Up @@ -4247,9 +4230,7 @@ TEST_CASE_METHOD(
create_temp_dir(temp_dir);
std::string path =
fs_vec_[0]->is_rest() ? "tiledb://unit/" + temp_dir : temp_dir;

std::string array_name = path + "dense_read_multi_index_complex";
create_temp_dir(temp_dir);

create_large_dense_array_1_attribute(array_name);

Expand Down Expand Up @@ -4317,9 +4298,7 @@ TEST_CASE_METHOD(
create_temp_dir(temp_dir);
std::string path =
fs_vec_[0]->is_rest() ? "tiledb://unit/" + temp_dir : temp_dir;

std::string array_name = path + "dense_read_multi_index_cross_tile";
create_temp_dir(temp_dir);

create_large_dense_array_1_attribute(array_name);

Expand Down Expand Up @@ -4370,9 +4349,7 @@ TEST_CASE_METHOD(
create_temp_dir(temp_dir);
std::string path =
fs_vec_[0]->is_rest() ? "tiledb://unit/" + temp_dir : temp_dir;

std::string array_name = path + "dense_read_multi_out_of_order";
create_temp_dir(temp_dir);

create_large_dense_array_1_attribute(array_name);

Expand Down Expand Up @@ -4423,9 +4400,7 @@ TEST_CASE_METHOD(
create_temp_dir(temp_dir);
std::string path =
fs_vec_[0]->is_rest() ? "tiledb://unit/" + temp_dir : temp_dir;

std::string array_name = path + "dense_read_multi_index_coalesce";
create_temp_dir(temp_dir);

create_large_dense_array_1_attribute(array_name);

Expand Down
4 changes: 0 additions & 4 deletions test/src/unit-capi-dense_neg.cc
Original file line number Diff line number Diff line change
Expand Up @@ -499,9 +499,7 @@ TEST_CASE_METHOD(
create_temp_dir(temp_dir);
std::string path =
fs_vec_[0]->is_rest() ? "tiledb://unit/" + temp_dir : temp_dir;

std::string vector_name = path + "dense_neg_vector";
create_temp_dir(temp_dir);

create_dense_vector(vector_name);
write_dense_vector(vector_name);
Expand All @@ -518,9 +516,7 @@ TEST_CASE_METHOD(
create_temp_dir(temp_dir);
std::string path =
fs_vec_[0]->is_rest() ? "tiledb://unit/" + temp_dir : temp_dir;

std::string vector_name = path + "dense_neg_array";
create_temp_dir(temp_dir);

create_dense_array(vector_name);
write_dense_array_global(vector_name);
Expand Down
6 changes: 3 additions & 3 deletions test/src/unit-capi-query-aggregate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@

using namespace tiledb::test;

struct QueryAggregateFx : TemporaryDirectoryFixture {
struct QueryAggregateFx {
QueryAggregateFx()
: ctx_(vfs_test_setup_.ctx_c)
: ctx(vfs_test_setup_.ctx_c)
, array_name_(vfs_test_setup_.array_uri("queryaggregate_array")) {
create_sparse_array();
write_sparse_array();
Expand All @@ -52,7 +52,7 @@ struct QueryAggregateFx : TemporaryDirectoryFixture {
void write_sparse_array();

VFSTestSetup vfs_test_setup_;
tiledb_ctx_t* ctx_;
tiledb_ctx_t* ctx;
std::string array_name_;
};

Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-capi-serialized_queries_using_subarray.cc
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ struct SerializationFx {
TEST_CASE_METHOD(
SerializationFx,
"subarray - Query serialization, dense",
"[query][dense][serialization][rest]") {
"[query][dense][serialization][rest-fails][sc-40489]") {
create_array(TILEDB_DENSE);
auto expected_results = write_dense_array();
check_subarray_stats(2, 2);
Expand Down
11 changes: 3 additions & 8 deletions test/src/unit-query-plan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@

using namespace tiledb;

#ifndef TILEDB_TESTS_ENABLE_REST
constexpr bool rest_tests = false;
#else
constexpr bool rest_tests = true;
#endif

struct QueryPlanFx {
QueryPlanFx();
~QueryPlanFx();
Expand Down Expand Up @@ -268,11 +262,12 @@ QueryPlanFx::QueryPlanFx()
QueryPlanFx::~QueryPlanFx() {
test::vfs_test_remove_temp_dir(ctx_c_, vfs_c_, temp_dir_);
test::vfs_test_close(fs_vec_, ctx_c_, vfs_c_).ok();
tiledb_ctx_free(&ctx_c_);
tiledb_vfs_free(&vfs_c_);
}

void QueryPlanFx::create_dense_array(const std::string& array_name) {
if constexpr (rest_tests) {
if (fs_vec_[0]->is_rest()) {
uri_ = "tiledb://unit/";
}

Expand Down Expand Up @@ -347,7 +342,7 @@ void QueryPlanFx::create_dense_array(const std::string& array_name) {
}

void QueryPlanFx::create_sparse_array(const std::string& array_name) {
if constexpr (rest_tests) {
if (fs_vec_[0]->is_rest()) {
uri_ = "tiledb://unit/";
}

Expand Down
19 changes: 5 additions & 14 deletions test/src/unit-sparse-global-order-reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1193,16 +1193,12 @@ TEST_CASE(

TEST_CASE(
"Sparse global order reader: attribute copy memory limit",
"[sparse-global-order][attribute-copy][memory-limit]") {
std::string array_name = "test_sparse_global_order";
"[sparse-global-order][attribute-copy][memory-limit][rest]") {
Config config;
config["sm.mem.total_budget"] = "10000";
Context ctx(config);
VFS vfs(ctx);

if (vfs.is_dir(array_name)) {
vfs.remove_dir(array_name);
}
VFSTestSetup vfs_test_setup(config.ptr().get());
std::string array_name = vfs_test_setup.array_uri("test_sparse_global_order");
auto ctx = vfs_test_setup.ctx();

// Create array with var-sized attribute.
Domain dom(ctx);
Expand Down Expand Up @@ -1237,8 +1233,7 @@ TEST_CASE(
query.set_data_buffer("d1", d1);
query.set_data_buffer("a", a1_data);
query.set_offsets_buffer("a", a1_offsets);
CHECK_NOTHROW(query.submit());
CHECK_NOTHROW(query.finalize());
CHECK_NOTHROW(query.submit_and_finalize());

// Read using a budget that can only fit one of the var size tiles.
Array array2(ctx, array_name, TILEDB_READ);
Expand Down Expand Up @@ -1267,10 +1262,6 @@ TEST_CASE(
CHECK(result_num == 4);

array2.close();

if (vfs.is_dir(array_name)) {
vfs.remove_dir(array_name);
}
}

TEST_CASE_METHOD(
Expand Down

0 comments on commit 326314a

Please sign in to comment.