Skip to content

Commit

Permalink
add delay to test
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisBiryukov91 committed Dec 12, 2024
1 parent bf3cdc8 commit 79ecfa3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/z_int_advanced_pub_sub_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ int run_publisher() {
SEM_WAIT(sem_sub);

// values for subscribe
for (int i = 0; i < values_count / 2; ++i) {
for (int i = values_count / 2; i < values_count; ++i) {
z_owned_bytes_t payload;
z_bytes_from_static_str(&payload, values[values_count / 2 + i]);
z_bytes_from_static_str(&payload, values[i]);
ze_advanced_publisher_put(z_loan(pub), z_move(payload), NULL);
}

Expand Down Expand Up @@ -124,6 +124,7 @@ void data_handler(z_loaned_sample_t *sample, void *arg) {
int run_subscriber() {
printf("wait: sem_pub\n");
SEM_WAIT(sem_pub);
z_sleep_s(1);

z_owned_config_t config;
z_config_default(&config);
Expand Down

0 comments on commit 79ecfa3

Please sign in to comment.