summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Monniez <moc@odoo.com>2018-10-24 13:34:59 +0000
committerChristophe Monniez <moc@odoo.com>2018-10-26 11:42:03 +0000
commite0219c7f39761ccc00f8ef1c73e9787a74feaf5c (patch)
treea75ee66512217f8f80407eead319615e8bfdd152
parent46f48c35a03ef03a5a45596ad66dd278e023a7b4 (diff)
[FIX] tests: avoid remaining requests
From times to times, warning are seen on the runbot during HttpCase tests with the chrome headless browser. Those warning are about Odoo trying to join remaining requests threads. In the dumpstack, the thread seems blocked in the werkzeug handle_one_request method, when trying to read the HTTP request line. One explanation could be that Chrome opens a pre-connect socket for a future use. When the HttpTest cleans the browser, the page stops loading but (probably) keeps the socket open for a while. That could explain the problem. With this commit, a timeout is set on the request handler, in the hope that it closes the pre-connect socket too. Cheery-pick of f9ee8cf to avoid runbot_merge failures. closes odoo/odoo#28193
-rw-r--r--odoo/service/server.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/odoo/service/server.py b/odoo/service/server.py
index d64b93d9e8c..04e13681661 100644
--- a/odoo/service/server.py
+++ b/odoo/service/server.py
@@ -100,6 +100,9 @@ class BaseWSGIServerNoBind(LoggingBaseWSGIServerMixIn, werkzeug.serving.BaseWSGI
class RequestHandler(werkzeug.serving.WSGIRequestHandler):
def setup(self):
+ # timeout to avoid chrome headless preconnect during tests
+ if config['test_enable'] or config['test_file']:
+ self.timeout = 5
# flag the current thread as handling a http request
super(RequestHandler, self).setup()
me = threading.currentThread()