From: Guus Sliepen Date: Sun, 13 Oct 2019 12:31:14 +0000 (+0200) Subject: Set a very small channel timeout in channels-failure test. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=22cef91d16dcef1c41fc187b870c112d3f408ac7;p=meshlink 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. --- 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.