From: <dg...@su...> - 2009-02-03 18:19:46
|
Author: Graham Cobb Date: Tue Feb 3 19:17:50 2009 New Revision: 5253 URL: http://www.opensync.org/changeset/5253 Log: Fix ipc_loop_timeout_with_idle so it fails for the old timeou code and passes with the new code Modified: branches/timeout/ChangeLog branches/timeout/tests/ipc-tests/check_ipc.c Modified: branches/timeout/ChangeLog ============================================================================== --- branches/timeout/ChangeLog Tue Feb 3 00:37:13 2009 (r5252) +++ branches/timeout/ChangeLog Tue Feb 3 19:17:50 2009 (r5253) @@ -1,3 +1,8 @@ +2009-02-03 Graham Cobb <g+...@co...> + + * tests/ipc-tests/check_ipc.c (ipc_loop_timeout_with_idle): Change test parameters + so test completes within 30 second limit. + 2009-02-02 Graham Cobb <g+...@co...> * opensync/ipc/opensync_queue_private.h (OSYNC_QUEUE_PENDING_QUEUE_MIN_TIMEOUT): Define Modified: branches/timeout/tests/ipc-tests/check_ipc.c ============================================================================== --- branches/timeout/tests/ipc-tests/check_ipc.c Tue Feb 3 00:37:13 2009 (r5252) +++ branches/timeout/tests/ipc-tests/check_ipc.c Tue Feb 3 19:17:50 2009 (r5253) @@ -2667,11 +2667,12 @@ /* Same as ipc_loop_with_timeout except that the client handler doesn't sleep, so the queue dispatchers can run while the operation is waiting. - Even though each action takes 1 second, none of these messages should time out - as they are being sent with a timeout of 3 seconds */ + Even though each action takes 1 second, and might be delayed by 3 seconds + due to the messages already processed on the pending queue, none of these + messages should time out as they are being sent with a timeout of 5 seconds */ num_msgs = 0; - req_msgs = 30; + req_msgs = 10; char *testbed = setup_testbed(NULL); osync_testing_file_remove("/tmp/testpipe-server"); @@ -2696,7 +2697,8 @@ OSyncThread *thread = osync_thread_new(context, &error); osync_queue_set_message_handler(client_queue, client_handler_first_part, GINT_TO_POINTER(1)); - osync_queue_set_pending_limit(client_queue, OSYNC_QUEUE_PENDING_LIMIT); + // Set pending limit to 3 so response wil be delayed at most 3 seconds + osync_queue_set_pending_limit(client_queue, 3); osync_queue_setup_with_gmainloop(client_queue, context); @@ -2768,7 +2770,8 @@ osync_message_set_handler(message, callback_handler_check_reply, GINT_TO_POINTER(1)); - fail_unless(osync_queue_send_message_with_timeout(client_queue, server_queue, message, 10, &error), NULL); + // Timeout of 5 will do as pending limit is 3 + fail_unless(osync_queue_send_message_with_timeout(client_queue, server_queue, message, 5, &error), NULL); fail_unless(!osync_error_is_set(&error), NULL); osync_message_unref(message); |