From cd7164f4e81070b25b2459b81bbaebdc6ac1dc22 Mon Sep 17 00:00:00 2001
From: Andreas Gohr <andi@splitbrain.org>
Date: Sat, 2 Sep 2017 10:54:21 +0200
Subject: [PATCH] another go at working around the networink troubles at travis
 #2109

---
 _test/tests/inc/httpclient_mock.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/_test/tests/inc/httpclient_mock.php b/_test/tests/inc/httpclient_mock.php
index 527ecf358..b66b90775 100644
--- a/_test/tests/inc/httpclient_mock.php
+++ b/_test/tests/inc/httpclient_mock.php
@@ -7,6 +7,7 @@
  */
 class HTTPMockClient extends HTTPClient {
     protected $tries;
+    protected $lasturl;
 
     /**
      * Sets shorter timeout
@@ -34,11 +35,13 @@ class HTTPMockClient extends HTTPClient {
      * @return bool
      */
     public function sendRequest($url, $data = '', $method = 'GET') {
+        $this->lasturl = $url;
         $this->tries = 2; // configures the number of retries
         $return      = false;
         while($this->tries) {
             $return = parent::sendRequest($url, $data, $method);
-            if($this->status != -100) break;
+            if($this->status != -100 && $this->status != 408) break;
+            usleep((3 - $this->tries) * 250000);
             $this->tries--;
         }
         return $return;
@@ -53,6 +56,7 @@ class HTTPMockClient extends HTTPClient {
     public function errorInfo($info = '') {
         return json_encode(
             array(
+                'URL' => $this->lasturl,
                 'Error' => $this->error,
                 'Status' => $this->status,
                 'Body' => $this->resp_body,
-- 
GitLab