Skip to content

Commit

Permalink
[#571] Set default publisher history to zero
Browse files Browse the repository at this point in the history
  • Loading branch information
elfenpiff committed Jan 2, 2025
1 parent 114f739 commit f5fa861
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config/iceoryx2.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ creation-timeout.nanos = 500000000
max-subscribers = 8
max-publishers = 2
max-nodes = 20
publisher-history-size = 1
publisher-history-size = 0
subscriber-max-buffer-size = 2
subscriber-max-borrowed-samples = 2
publisher-max-loaned-samples = 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,8 @@ TYPED_TEST(ServicePublishSubscribeTest, update_connections_delivers_history) {
const auto service_name = iox2_testing::generate_service_name();

auto node = NodeBuilder().create<SERVICE_TYPE>().expect("");
auto service = node.service_builder(service_name).template publish_subscribe<uint64_t>().create().expect("");
auto service =
node.service_builder(service_name).template publish_subscribe<uint64_t>().history_size(1).create().expect("");

auto sut_publisher = service.publisher_builder().create().expect("");
const uint64_t payload = 123;
Expand Down
2 changes: 1 addition & 1 deletion iceoryx2/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ impl Default for Config {
max_subscribers: 8,
max_publishers: 2,
max_nodes: 20,
publisher_history_size: 1,
publisher_history_size: 0,
subscriber_max_buffer_size: 2,
subscriber_max_borrowed_samples: 2,
publisher_max_loaned_samples: 2,
Expand Down
1 change: 1 addition & 0 deletions iceoryx2/src/port/update_connections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ pub trait UpdateConnections {
/// #
/// # let service = node.service_builder(&"My/Funk/ServiceName".try_into()?)
/// # .publish_subscribe::<u64>()
/// # .history_size(1)
/// # .open_or_create()?;
/// #
/// # let publisher = service.publisher_builder().create()?;
Expand Down
4 changes: 2 additions & 2 deletions iceoryx2/src/service/static_config/messaging_pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ mod tests {
let cfg = config::Config::default();
let p1 = MessagingPattern::PublishSubscribe(publish_subscribe::StaticConfig::new(&cfg));
let sut = p1.required_amount_of_samples_per_data_segment(0);
assert_that!(sut, eq 33);
assert_that!(sut, eq 32);
let sut = p1.required_amount_of_samples_per_data_segment(1);
assert_that!(sut, eq 34);
assert_that!(sut, eq 33);

let e1 = MessagingPattern::Event(event::StaticConfig::new(&cfg));
let sut = e1.required_amount_of_samples_per_data_segment(1);
Expand Down
3 changes: 2 additions & 1 deletion iceoryx2/tests/sample_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ mod sample {

#[test]
fn sample_from_dropped_subscriber_does_not_block_new_subscribers<Sut: Service>() {
let config = generate_isolated_config();
let mut config = generate_isolated_config();
config.defaults.publish_subscribe.publisher_history_size = 1;
let test_context = TestContext::<Sut>::new(&config);
const PAYLOAD_1: u64 = 7781123554;

Expand Down

0 comments on commit f5fa861

Please sign in to comment.