Skip to content

C++ integration test#352

Open
leekeiabstraction wants to merge 1 commit intoapache:mainfrom
leekeiabstraction:cpp-integration-test
Open

C++ integration test#352
leekeiabstraction wants to merge 1 commit intoapache:mainfrom
leekeiabstraction:cpp-integration-test

Conversation

@leekeiabstraction
Copy link
Contributor

Purpose

Linked issue: close #338

Brief change log

  • Add C++ client integration tests
  • Update CI to trigger CI test more selectively

@leekeiabstraction
Copy link
Contributor Author

@fresh-borzoni Appreciate your review here 🙏

@fresh-borzoni
Copy link
Contributor

fresh-borzoni commented Feb 18, 2026

@leekeiabstraction, it might be the case that we would need to get #351 merged first
I changes some C++ API to match between clients:

  • Size() to Count() on ScanRecord, it matches Java/Rust
  • Empty() to isEmpty() on ScanRecords, it matches Java/Rust
  • we still support flat iteration: for (const auto& rec : scan_records) , but not indexing as it isn't exposed in Java/Rust, so I removed it, still exposed it in Python as it's more pythonic, but it's debatable

@leekeiabstraction
Copy link
Contributor Author

That is fine. We can update this afterwards

@leekeiabstraction
Copy link
Contributor Author

Still appreciate your early review on the other parts within this PR though! 🙏🏼

Copy link
Contributor

@fresh-borzoni fresh-borzoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leekeiabstraction Ty for the PR.

quickly looked through. Left couple of comments, but still 'review in progress'
PTAL

}

// Wait for ZooKeeper to be ready before starting Fluss servers
std::this_thread::sleep_for(std::chrono::seconds(5));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mb we should just poll for some readiness?

it's a bit more predictable, though I'm not sure what to chose as readiness marker, in rust we have .get_cluster().get_one_available_server() which seems specific to rust implementation only.

inline std::vector<fluss::ScanRecord> PollRecords(fluss::LogScanner& scanner,
size_t expected_count,
int timeout_seconds = 10) {
// We need to keep the ScanRecords alive since ScanRecord borrows from them
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we shall remove it as it just returns empty vector in the end.
But it actually made me think - mb we should just use shared_ptr and I overcomplicated this pattern, it basically would be Arc from Rust.

prepared the fix for this: seems to work and better overall: #353


namespace fluss_test {

static constexpr const char* kFlussVersion = "0.7.0";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it drift?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great question, it would, parameterising server version would be a good approach to take.

We'd want to parameterise this across different ITs, within website (for back referencing to main Fluss website) and anywhere else that might be applicable.

However I think we can address parameterising as an issue / separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Raised issue: #354

Copy link
Contributor

@fresh-borzoni fresh-borzoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leekeiabstraction finished review, left comments. PTAL

also once scan by buckets PR is merged - we need to add some tests for it


// Create partial update writer to update only score column
auto partial_upsert = table.NewUpsert();
partial_upsert.PartialUpdateByName({"id", "score"});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we wish to test by Index as well?

auto table_scan = scan_table.NewScan();
fluss::LogScanner log_scanner;
ASSERT_OK(table_scan.CreateLogScanner(log_scanner));
ASSERT_OK(log_scanner.Subscribe(0, 0));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we subscribe to single bucket? what if records would be distributed to different buckets?
We need to set bucket to 1 for the table at least.

the same pattern in other places, PTAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

C++ Integration tests

2 participants

Comments