Skip to content

Commit

Permalink
make tests less fragile by waiting a bit for sessions to mutually dis…
Browse files Browse the repository at this point in the history
…cover
  • Loading branch information
p-avital committed Jan 15, 2024
1 parent c4f4346 commit 6e2e4bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion tests/z_int_queryable_error_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// ZettaScale Zenoh Team, <[email protected]>
//

#include <unistd.h>

#include "z_int_helpers.h"

#ifdef VALID_PLATFORM
Expand Down Expand Up @@ -51,7 +53,7 @@ int run_queryable() {
}

SEM_POST(sem);
sleep(10);
sleep(5);

z_drop(z_move(qable));
z_close(z_move(s));
Expand All @@ -78,6 +80,7 @@ int run_get() {
perror("Unable to open session!");
return -1;
}
sleep(1);

z_get_options_t opts = z_get_options_default();
z_owned_closure_reply_t closure_reply = z_closure(reply_handler, NULL, &s);
Expand Down
3 changes: 2 additions & 1 deletion tests/z_int_queryable_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ int run_queryable() {
}

SEM_POST(sem);
sleep(10);
sleep(5);

z_drop(z_move(qable));
z_close(z_move(s));
Expand All @@ -75,6 +75,7 @@ int run_get() {
perror("Unable to open session!");
return -1;
}
sleep(1);

for (int val_num = 0; val_num < values_count; ++val_num) {
z_owned_reply_channel_t channel = zc_reply_fifo_new(16);
Expand Down

0 comments on commit 6e2e4bd

Please sign in to comment.