summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorGéry Debongnie <ged@odoo.com>2015-10-01 10:12:35 +0200
committerGéry Debongnie <ged@odoo.com>2015-10-01 14:00:20 +0200
commit673f4aa4a77161dc58e0e1bf97e8f713b1e88491 (patch)
tree1e3e6b7e48a32bd847ad766f6668b161e35897fb /addons/web/static/src/js
parent730efcc3df71174d6267392efac527efcd740956 (diff)
[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.
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/framework/ajax.js4
1 files changed, 3 insertions, 1 deletions
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;