diff --git a/examples/unix/c11/z_liveliness.c b/examples/unix/c11/z_liveliness.c index f120156ee..0db1a9c10 100644 --- a/examples/unix/c11/z_liveliness.c +++ b/examples/unix/c11/z_liveliness.c @@ -11,7 +11,6 @@ // Contributors: // ZettaScale Zenoh Team, -#include #include #include #include @@ -98,7 +97,7 @@ int main(int argc, char **argv) { printf("Press CTRL-C to undeclare liveliness token and quit...\n"); z_clock_t clock = z_clock_now(); while (timeout == 0 || z_clock_elapsed_s(&clock) < timeout) { - z_sleep_s(1); + z_sleep_ms(100); } // LivelinessTokens are automatically closed when dropped diff --git a/tests/memory_leak.py b/tests/memory_leak.py index 9e5d90382..4095a136c 100644 --- a/tests/memory_leak.py +++ b/tests/memory_leak.py @@ -121,11 +121,11 @@ def query_and_queryable(query_cmd, queryable_cmd): z_query_process.wait() print(f"Stop {queryable_cmd}") - time.sleep(10) + time.sleep(5) if z_queryable_process.poll() is None: # send SIGINT to group z_quaryable_process_gid = os.getpgid(z_queryable_process.pid) - # os.killpg(z_quaryable_process_gid, signal.SIGINT) + os.killpg(z_quaryable_process_gid, signal.SIGINT) # Wait for z_queryable to finish z_queryable_process.wait() @@ -159,23 +159,23 @@ def query_and_queryable(query_cmd, queryable_cmd): EXIT_STATUS = 0 # Test failure mode - # print("*** Failure mode ***") - # if failure_mode('z_pub -m peer') == 1: - # EXIT_STATUS = 1 + print("*** Failure mode ***") + if failure_mode('z_pub -m peer') == 1: + EXIT_STATUS = 1 ## Test pub and sub examples - # print("*** Pub & sub test ***") - # if pub_and_sub('z_pub -n 1', 'z_sub -n 1') == 1: - # EXIT_STATUS = 1 - # print("*** Pub & sub attachment test ***") - # if pub_and_sub('z_pub_attachment -n 1', 'z_sub_attachment -n 1') == 1: - # EXIT_STATUS = 1 + print("*** Pub & sub test ***") + if pub_and_sub('z_pub -n 1', 'z_sub -n 1') == 1: + EXIT_STATUS = 1 + print("*** Pub & sub attachment test ***") + if pub_and_sub('z_pub_attachment -n 1', 'z_sub_attachment -n 1') == 1: + EXIT_STATUS = 1 # Test query and queryable examples - # print("*** Query & queryable test ***") - # if query_and_queryable('z_get', 'z_queryable -n 1') == 1: - # EXIT_STATUS = 1 - # print("*** Query & queryable attachment test ***") - # if query_and_queryable('z_get_attachment -v Something', 'z_queryable_attachment -n 1') == 1: - # EXIT_STATUS = 1 + print("*** Query & queryable test ***") + if query_and_queryable('z_get', 'z_queryable -n 1') == 1: + EXIT_STATUS = 1 + print("*** Query & queryable attachment test ***") + if query_and_queryable('z_get_attachment -v Something', 'z_queryable_attachment -n 1') == 1: + EXIT_STATUS = 1 # Test liveliness query print("*** Get liveliness test ***") if query_and_queryable('z_get_liveliness', 'z_liveliness -t 5') == 1: @@ -183,7 +183,7 @@ def query_and_queryable(query_cmd, queryable_cmd): # Test liveliness subscriber print("*** Liveliness subscriber test ***") sys.exit(0) - # if query_and_queryable('z_sub_liveliness -h -n 1', 'z_liveliness') == 1: - # EXIT_STATUS = 1 + if query_and_queryable('z_sub_liveliness -h -n 1', 'z_liveliness -t 1') == 1: + EXIT_STATUS = 1 # Exit - # sys.exit(EXIT_STATUS) + sys.exit(EXIT_STATUS)