Fix testcase 0373
authorJeremy Harris <jgh146exb@wizmail.org>
Sun, 15 Jun 2014 14:48:55 +0000 (15:48 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Sun, 15 Jun 2014 14:48:55 +0000 (15:48 +0100)
A readsocket expansion against a unix-domain socket which is
immediately closed.  This gave variable results does to the race of
the write into the client-end versus the close at the server end.
Insert under-testsuite delays to assure sequencing; the testcase
now specifically looks for a write into a closed peer.

src/src/expand.c

index ff30996a9cec678de87769585fdb64ea3ad1509b..b02ea30a29fb4b183128c6b6b2cddc8829af10d0 100644 (file)
@@ -4667,6 +4667,9 @@ while (*s != 0)
 
         DEBUG(D_expand) debug_printf("connected to socket %s\n", sub_arg[0]);
 
+       /* Allow sequencing of test actions */
+       if (running_in_test_harness) millisleep(100);
+
         /* Write the request string, if not empty */
 
         if (sub_arg[1][0] != 0)
@@ -4690,6 +4693,8 @@ while (*s != 0)
         shutdown(fd, SHUT_WR);
         #endif
 
+       if (running_in_test_harness) millisleep(100);
+
         /* Now we need to read from the socket, under a timeout. The function
         that reads a file can be used. */