Skip to content

feat(cpp): add functions related to system#3102

Open
slbotbm wants to merge 2 commits intoapache:masterfrom
slbotbm:cpp-system-functions
Open

feat(cpp): add functions related to system#3102
slbotbm wants to merge 2 commits intoapache:masterfrom
slbotbm:cpp-system-functions

Conversation

@slbotbm
Copy link
Copy Markdown
Contributor

@slbotbm slbotbm commented Apr 12, 2026

Which issue does this PR close?

Works toward completion of #2100

Rationale

This PR adds functions related to the system, and tests for previously untested functions.

What changed?

This PR adds:

  • The following functions and their tests:
    • get_stats
    • get_me
    • get_client
    • get_clients
    • ping
    • heartbeat_interval
    • snapshot

The places labelled TODO will be completed after merging of #3046.

Local Execution

  • Passed
  • Pre-commit hooks ran

AI Usage

If AI tools were used, please answer:

  1. Which tools? (e.g., GitHub Copilot, Claude, ChatGPT) codex
  2. Scope of usage? (e.g., autocomplete, generated functions, entire implementation) code generation based on explicit instructions given by me.
  3. How did you verify the generated code works correctly? ran the tests, read through and understood the generated code
  4. Can you explain every line of the code if asked? yes

@slbotbm slbotbm marked this pull request as draft April 12, 2026 14:29
@slbotbm slbotbm changed the title feata(cpp): add functions related to system, tests for purge_* functions, and consumer group functions (WIP) feat(cpp): add functions related to system, tests for purge_* functions, and consumer group functions (WIP) Apr 12, 2026
@slbotbm slbotbm marked this pull request as ready for review April 22, 2026 11:19
@slbotbm
Copy link
Copy Markdown
Contributor Author

slbotbm commented Apr 22, 2026

This PR is ready for review

@slbotbm slbotbm changed the title feat(cpp): add functions related to system, tests for purge_* functions, and consumer group functions (WIP) feat(cpp): add functions related to system Apr 25, 2026
Comment thread foreign/cpp/src/client.rs Outdated
Comment thread foreign/cpp/src/client.rs Outdated
Comment thread foreign/cpp/src/lib.rs
Comment thread foreign/cpp/src/lib.rs
Comment thread foreign/cpp/src/lib.rs
ASSERT_NE(client, nullptr);

const auto heartbeat_interval = client->heartbeat_interval();
EXPECT_EQ(heartbeat_interval, 5'000'000u);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

magic 5'000'000u (and 10'000'000u at L757). define constexpr std::uint64_t kDefaultHeartbeatMicros = 5'000'000ull; or derive from IggyDuration::from("5s").as_micros().

Comment thread foreign/cpp/tests/client/low_level_e2e.cpp
ASSERT_NO_THROW(client->connect());
ASSERT_THROW(client->get_stats(), std::exception);

ASSERT_NO_THROW(iggy::ffi::delete_connection(client));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

every test manually does delete_connection(client); client = nullptr;. wrap in struct ScopedClient { ~ScopedClient() { iggy::ffi::delete_connection(p); } }; to cut ~30 lines of boilerplate and recover correctness on test-assertion failure - today the connection leaks if an ASSERT_* aborts mid-test.

Comment thread foreign/cpp/tests/client/low_level_e2e.cpp Outdated
Comment thread foreign/cpp/build.rs Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs.

If you need a review, please ensure CI is green and the PR is rebased on the latest master. Don't hesitate to ping the maintainers - either @core on Discord or by mentioning them directly here on the PR.

Thank you for your contribution!

@github-actions github-actions Bot added the stale Inactive issue or pull request label May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Inactive issue or pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants