~brianaker/libmemcached/1164440

« back to all changes in this revision

Viewing changes to libtest/server.cc

Merging bzr://gaz.tangent.org/libmemcached/build/ to Build branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
198
198
    }
199
199
  }
200
200
 
201
 
  int counter= 0;
202
201
  bool pinged= false;
203
 
  while ((pinged= ping()) == false and
204
 
         counter < (is_helgrind() or is_valgrind() ? 20 : 5))
205
202
  {
206
 
    dream(counter++, 50000);
 
203
    uint32_t timeout= 20; // This number should be high enough for valgrind startup (which is slow)
 
204
    uint32_t waited;
 
205
    uint32_t this_wait;
 
206
    uint32_t retry;
 
207
 
 
208
    for (waited= 0, retry= 1; ; retry++, waited+= this_wait)
 
209
    {
 
210
      if ((pinged= ping()) == true)
 
211
      {
 
212
        break;
 
213
      }
 
214
      else if (waited >= timeout)
 
215
      {
 
216
        break;
 
217
      }
 
218
 
 
219
      this_wait= retry * retry / 3 + 1;
 
220
      libtest::dream(this_wait, 0);
 
221
    }
207
222
  }
208
223
 
209
224
  if (pinged == false)