Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch intermittent failure in SchemaEvolution test. #5435

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 22 additions & 14 deletions test/src/unit-cppapi-schema-evolution.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* The MIT License
*
* @copyright Copyright (c) 2023-2024 TileDB Inc.
* @copyright Copyright (c) 2023-2025 TileDB Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -806,21 +806,21 @@ TEST_CASE(
}
}

TEST_CASE(
"C++ API: SchemaEvolution, drop fixed attribute and add back as var-sized",
"[cppapi][schema][evolution][add][drop]") {
/**
* C++ API: SchemaEvolution, drop fixed attribute and add back as var-sized
*
* Wrapper function for the following test case of the same name.
* This logic has been moved into a function to resolve intermittent failures
* when using Catch2's GENERATE statements inline with code under test
* (https://app.shortcut.com/tiledb-inc/story/61528).
* We should re-evaluate when Catch2 is upgraded.
*/
void test_schema_evolution_drop_fixed_add_var(
tiledb_array_type_t array_type, tiledb_layout_t layout) {
test::VFSTestSetup vfs_test_setup;
Context ctx{vfs_test_setup.ctx()};
auto array_uri{
vfs_test_setup.array_uri("test_schema_evolution_drop_fixed_add_var")};
tiledb_array_type_t array_type = TILEDB_DENSE;
bool allows_dups = false;
auto layout = GENERATE(TILEDB_UNORDERED, TILEDB_GLOBAL_ORDER);

SECTION("sparse") {
array_type = TILEDB_SPARSE;
allows_dups = GENERATE(true, false);
}

// Create array
Domain domain(ctx);
Expand All @@ -830,8 +830,7 @@ TEST_CASE(
auto b = Attribute::create<int>(ctx, "b");
ArraySchema schema(ctx, array_type);
schema.set_domain(domain);
schema.set_allows_dups(allows_dups);
CHECK(allows_dups == schema.allows_dups());
schema.set_allows_dups(false);
schema.add_attribute(a);
schema.add_attribute(b);
schema.set_cell_order(TILEDB_ROW_MAJOR);
Expand Down Expand Up @@ -908,6 +907,15 @@ TEST_CASE(
Catch::Matchers::Equals(std::vector<int>{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}));
}

TEST_CASE(
"C++ API: SchemaEvolution, drop fixed attribute and add back as var-sized",
"[cppapi][schema][evolution][add][drop]") {
test_schema_evolution_drop_fixed_add_var(TILEDB_DENSE, TILEDB_UNORDERED);
test_schema_evolution_drop_fixed_add_var(TILEDB_DENSE, TILEDB_GLOBAL_ORDER);
test_schema_evolution_drop_fixed_add_var(TILEDB_SPARSE, TILEDB_UNORDERED);
test_schema_evolution_drop_fixed_add_var(TILEDB_SPARSE, TILEDB_GLOBAL_ORDER);
}

TEST_CASE(
"SchemaEvolution Error Handling Tests",
"[cppapi][schema][evolution][errors][rest]") {
Expand Down
Loading