From 673f4aa4a77161dc58e0e1bf97e8f713b1e88491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Thu, 1 Oct 2015 10:12:35 +0200 Subject: [FIX] bus: disable longpolling in test mode In test mode, only one cursor is available, and longpolling will take it, and not give it back before 60s, causing a phantomjs timeout. This commit simply return an error when the server is in test mode. Sadly, I had to patch the web client to prevent logging the error in this case, because that's the way phantomjs detect if there is a problem. --- addons/web/static/src/js/framework/ajax.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js/framework') diff --git a/addons/web/static/src/js/framework/ajax.js b/addons/web/static/src/js/framework/ajax.js index d6619449a0f..869e0214ad9 100644 --- a/addons/web/static/src/js/framework/ajax.js +++ b/addons/web/static/src/js/framework/ajax.js @@ -15,7 +15,9 @@ function genericJsonRpc (fct_name, params, fct) { var xhr = fct(data); var result = xhr.pipe(function(result) { if (result.error !== undefined) { - console.error("Server application error", JSON.stringify(result.error)); + if (result.error.data.arguments[0] !== "bus.Bus not available in test mode") { + console.error("Server application error", JSON.stringify(result.error)); + } return $.Deferred().reject("server", result.error); } else { return result.result; -- cgit v1.2.3