Commits

Robert Brewer committed 49832be

Fixed test_refleaks for some platforms (also for use with the --client command-line arg).

  • Participants
  • Parent commits 292d7ef

Comments (0)

Files changed (1)

File cherrypy/test/test_refleaks.py

         success = []
         
         def getpage():
-            host = '127.0.0.1:%s' % self.PORT
+            host = '%s:%s' % (self.HOST, self.PORT)
             if self.scheme == 'https':
                 c = httplib.HTTPSConnection(host)
             else:
                 c = httplib.HTTPConnection(host)
             try:
-                c.putrequest('GET', '/', skip_host=0)
-                c.putheader('Host', host)
+                c.putrequest('GET', '/')
                 c.endheaders()
                 response = c.getresponse()
                 body = response.read()
                 c.close()
             success.append(True)
         
+        ITERATIONS = 25
         ts = []
-        for _ in range(25):
+        for _ in range(ITERATIONS):
             t = threading.Thread(target=getpage)
             ts.append(t)
             t.start()
         for t in ts:
             t.join()
         
-        self.assertEqual(len(success), 25)
+        self.assertEqual(len(success), ITERATIONS)
         
         self.getPage("/gc_stats")
         self.assertBody("Statistics:")
 
 if __name__ == '__main__':
     setup_server()
-    helper.testmain()
+    helper.testmain({'server.socket_queue_size': 10})