Skip to content

Commit 0368952

Browse files
Sandeep GottimukkalaSandeep Gottimukkala
authored andcommitted
Test
1 parent ab6c8d4 commit 0368952

File tree

1 file changed

+12
-24
lines changed

1 file changed

+12
-24
lines changed

src/iceberg/test/rest_catalog_integration_test.cc

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -488,15 +488,10 @@ TEST_F(RestCatalogIntegrationTest, FetchPlanningResult) {
488488
internal::TableScanContext context;
489489
ICEBERG_UNWRAP_OR_FAIL(auto plan_response, catalog->PlanTableScan(*table, context));
490490

491-
if (!plan_response.plan_id.empty()) {
492-
// Async plan: fetch the result using the returned plan_id
493-
ICEBERG_UNWRAP_OR_FAIL(auto fetch_response,
494-
catalog->FetchPlanningResult(*table, plan_response.plan_id));
495-
EXPECT_TRUE(fetch_response.file_scan_tasks.empty());
496-
} else {
497-
// Synchronous plan: file_scan_tasks already returned; verify nonexistent plan_id errors
498-
EXPECT_FALSE(catalog->FetchPlanningResult(*table, "nonexistent-plan-id").has_value());
499-
}
491+
// NOTE: apache/iceberg-rest-fixture always responds synchronously (status="completed")
492+
// with a non-empty plan_id (e.g. "sync-<uuid>"). Sync plans are immediately discarded
493+
// server-side. Async paths are covered by unit tests.
494+
EXPECT_FALSE(plan_response.plan_id.empty());
500495
}
501496

502497
TEST_F(RestCatalogIntegrationTest, CancelPlanning) {
@@ -509,13 +504,10 @@ TEST_F(RestCatalogIntegrationTest, CancelPlanning) {
509504
internal::TableScanContext context;
510505
ICEBERG_UNWRAP_OR_FAIL(auto plan_response, catalog->PlanTableScan(*table, context));
511506

512-
if (!plan_response.plan_id.empty()) {
513-
// Async plan: cancel it
514-
ASSERT_THAT(catalog->CancelPlanning(*table, plan_response.plan_id), IsOk());
515-
} else {
516-
// Synchronous plan: verify cancelling a nonexistent plan_id returns an error
517-
EXPECT_FALSE(catalog->CancelPlanning(*table, "nonexistent-plan-id").has_value());
518-
}
507+
// NOTE: apache/iceberg-rest-fixture always responds synchronously — sync plan_id is
508+
// accepted for cancellation (idempotent). Async paths are covered by unit tests.
509+
ASSERT_FALSE(plan_response.plan_id.empty());
510+
ASSERT_THAT(catalog->CancelPlanning(*table, plan_response.plan_id), IsOk());
519511
}
520512

521513
TEST_F(RestCatalogIntegrationTest, FetchScanTasks) {
@@ -528,14 +520,10 @@ TEST_F(RestCatalogIntegrationTest, FetchScanTasks) {
528520
internal::TableScanContext context;
529521
ICEBERG_UNWRAP_OR_FAIL(auto plan_response, catalog->PlanTableScan(*table, context));
530522

531-
if (!plan_response.plan_tasks.empty()) {
532-
// Use the first plan task token to fetch scan tasks
533-
ICEBERG_UNWRAP_OR_FAIL(
534-
auto tasks_response,
535-
catalog->FetchScanTasks(*table, plan_response.plan_tasks[0]));
536-
EXPECT_TRUE(tasks_response.file_scan_tasks.empty());
537-
}
538-
// If synchronous plan (no plan_tasks), file_scan_tasks are already in plan_response
523+
// NOTE: apache/iceberg-rest-fixture always responds synchronously — plan_tasks is
524+
// always empty. FetchScanTasks is only relevant for async plans; async paths are
525+
// covered by unit tests.
526+
EXPECT_TRUE(plan_response.plan_tasks.empty());
539527
}
540528

541529
// -- Snapshot loading mode --

0 commit comments

Comments
 (0)