From 22cef91d16dcef1c41fc187b870c112d3f408ac7 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sun, 13 Oct 2019 14:31:14 +0200 Subject: [PATCH] Set a very small channel timeout in channels-failure test. This tests both the meshlink_set_node_channel_timeout() function and greatly speeds up the test. --- test/channels-failure.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/channels-failure.c b/test/channels-failure.c index 34018e11..18aef2d5 100644 --- a/test/channels-failure.c +++ b/test/channels-failure.c @@ -72,11 +72,15 @@ int main() { sleep(1); + // Set a very small timeout for channels to b. + + meshlink_set_node_channel_timeout(mesh_a, b, 1); + // Stop mesh_b. We should get a notification that the channel has closed after a while. meshlink_stop(mesh_b); - assert(wait_sync_flag(&receive_flag, 70)); + assert(wait_sync_flag(&receive_flag, 5)); assert(receive_len == 0); meshlink_channel_close(mesh_a, channel); @@ -91,7 +95,7 @@ int main() { meshlink_set_channel_poll_cb(mesh_a, channel, poll_cb); - assert(wait_sync_flag(&poll_flag, 70)); + assert(wait_sync_flag(&poll_flag, 5)); assert(poll_len == 0); // Clean up. -- 2.39.5