You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by tr...@apache.org on 2009/11/08 20:54:47 UTC
svn commit: r833920 - /apr/apr/branches/1.4.x/test/testsock.c
Author: trawick
Date: Sun Nov 8 19:54:46 2009
New Revision: 833920
URL: http://svn.apache.org/viewvc?rev=833920&view=rev
Log:
Merge r833907 from trunk:
don't assume child process can both connect and close before parent can
both accept and look for EOF
(fixes intermittent failure seen on Linux and OpenSolaris)
Modified:
apr/apr/branches/1.4.x/test/testsock.c
Modified: apr/apr/branches/1.4.x/test/testsock.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/test/testsock.c?rev=833920&r1=833919&r2=833920&view=diff
==============================================================================
--- apr/apr/branches/1.4.x/test/testsock.c (original)
+++ apr/apr/branches/1.4.x/test/testsock.c Sun Nov 8 19:54:46 2009
@@ -241,9 +241,14 @@
rv = apr_socket_accept(&sock2, sock, p);
APR_ASSERT_SUCCESS(tc, "Problem with receiving connection", rv);
- /* The child closed the socket instantly */
+ /* The child closed the socket as soon as it could... */
rv = apr_socket_atreadeof(sock2, &atreadeof);
APR_ASSERT_SUCCESS(tc, "Determine whether at EOF, #3", rv);
+ if (!atreadeof) { /* ... but perhaps not yet; wait a moment */
+ apr_sleep(apr_time_from_msec(5));
+ rv = apr_socket_atreadeof(sock2, &atreadeof);
+ APR_ASSERT_SUCCESS(tc, "Determine whether at EOF, #4", rv);
+ }
ABTS_INT_EQUAL(tc, 1, atreadeof);
wait_child(tc, &proc);