Skip to content

Commit

Permalink
Attempt to fix CI again
Browse files Browse the repository at this point in the history
  • Loading branch information
ypatia committed Oct 16, 2024
1 parent 53e5d39 commit a89b6dc
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions test/src/unit-cppapi-group.cc
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ TEST_CASE_METHOD(
std::string array1_uri = vfs_test_setup_.array_uri("array1");
std::string array2_uri = vfs_test_setup_.array_uri("array2");
std::string array3_uri = vfs_test_setup_.array_uri("array3");
std::cerr << array1_uri << std::endl;


create_array(array1_uri);
create_array(array2_uri);
Expand All @@ -310,20 +312,25 @@ TEST_CASE_METHOD(
std::string group2_uri = vfs_test_setup_.array_uri("group2");
tiledb::Group::create(ctx_, group1_uri);
tiledb::Group::create(ctx_, group2_uri);
std::cerr << group1_uri << std::endl;

// Set expected
auto uri_format = [&](std::string uri) {
return vfs_test_setup_.is_rest() ? vfs_test_setup_.with_prefix(uri) : uri;
};
auto expected_uri = vfs_test_setup_.is_rest() ? vfs_test_setup_.with_prefix(array1_uri) : array1_uri;
std::vector<tiledb::Object> group1_expected = {
tiledb::Object(
tiledb::Object::Type::Array,
vfs_test_setup_.with_prefix(array1_uri),
uri_format(array1_uri),
"array1"),
tiledb::Object(
tiledb::Object::Type::Array,
vfs_test_setup_.with_prefix(array2_uri),
uri_format(array2_uri),
"array2"),
tiledb::Object(
tiledb::Object::Type::Group,
vfs_test_setup_.with_prefix(group2_uri),
uri_format(group2_uri),
"group2"),
};
std::vector<std::tuple<tiledb::Object::Type, std::optional<std::string>>>
Expand All @@ -334,12 +341,13 @@ TEST_CASE_METHOD(
std::vector<tiledb::Object> group2_expected = {
tiledb::Object(
tiledb::Object::Type::Array,
vfs_test_setup_.with_prefix(array3_uri),
uri_format(array3_uri),
"array3"),
};
std::vector<std::tuple<tiledb::Object::Type, std::optional<std::string>>>
group2_exp_det = {{tiledb::Object::Type::Array, "array3"}};

sleep(5);
tiledb::Group group1(ctx_, group1_uri, TILEDB_WRITE);
group1.close();
set_group_timestamp(&group1, 1);
Expand All @@ -363,6 +371,7 @@ TEST_CASE_METHOD(
group2.add_member(array3_uri, false, "array3");
}

sleep(5);
// Close group from write mode
group1.close();
group2.close();
Expand Down Expand Up @@ -392,6 +401,7 @@ TEST_CASE_METHOD(
}

// Close group
sleep(5);
group1.close();
group2.close();

Expand All @@ -412,6 +422,7 @@ TEST_CASE_METHOD(
group2_exp_det.clear();

// Close group
sleep(5);
group1.close();
group2.close();

Expand Down Expand Up @@ -442,6 +453,7 @@ TEST_CASE_METHOD(
REQUIRE_THROWS(group1.member(group1_expected.size()));

// Close group
sleep(5);
group1.close();
group2.close();
}
Expand All @@ -465,18 +477,21 @@ TEST_CASE_METHOD(
tiledb::Group::create(ctx_, group2_uri);

// Set expected
auto uri_format = [&](std::string uri) {
return vfs_test_setup_.is_rest() ? vfs_test_setup_.with_prefix(uri) : uri;
};
std::vector<tiledb::Object> group1_expected = {
tiledb::Object(
tiledb::Object::Type::Array,
vfs_test_setup_.with_prefix(array1_uri),
uri_format(array1_uri),
std::nullopt),
tiledb::Object(
tiledb::Object::Type::Array,
vfs_test_setup_.with_prefix(array2_uri),
uri_format(array2_uri),
std::nullopt),
tiledb::Object(
tiledb::Object::Type::Group,
vfs_test_setup_.with_prefix(group2_uri),
uri_format(group2_uri),
std::nullopt),
};
std::vector<std::tuple<tiledb::Object::Type, std::optional<std::string>>>
Expand All @@ -487,7 +502,7 @@ TEST_CASE_METHOD(
std::vector<tiledb::Object> group2_expected = {
tiledb::Object(
tiledb::Object::Type::Array,
vfs_test_setup_.with_prefix(array3_uri),
uri_format(array3_uri),
std::nullopt),
};
std::vector<std::tuple<tiledb::Object::Type, std::optional<std::string>>>
Expand Down

0 comments on commit a89b6dc

Please sign in to comment.