Skip to content

Commit

Permalink
retry to read the sent request a few times if it doesn't exist the fi…
Browse files Browse the repository at this point in the history
…rst time
  • Loading branch information
bagder committed Jun 22, 2004
1 parent dca6386 commit 38dc548
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions tests/runtests.pl
Expand Up @@ -1161,8 +1161,22 @@ sub singletest {
}

if(@protocol) {
# verify the sent request
my @out = loadarray($SERVERIN);
my @out;
my $retry = 5;

# Verify the sent request. Sometimes, like in test 513 on some hosts,
# curl will return back faster than the server writes down the request
# to its file, so we might need to wait here for a while to see if the
# file gets written a bit later.

while($retry--) {
@out = loadarray($SERVERIN);

if(!$out[0]) {
# nothing there yet, wait a while and try again
sleep(1);
}
}

# what to cut off from the live protocol sent by curl
my @strip = getpart("verify", "strip");
Expand Down

0 comments on commit 38dc548

Please sign in to comment.