From e418b5fdb9f70a99d6874fd3341e64c5d5bc391a Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Sat, 22 Oct 2011 13:48:47 -0400 Subject: [PATCH] Bug 696009 and bug 695947 - frequent linux-pgo intermittent oranges since Bug 615976 (WebGL AA) landed - no review, fix bustage We've seen frequent intermittent failures in WebGL tests since WebGL AA landed. This turns out to be OOM conditions leading to failure to create WebGL contexts, due to the fact that the JS engine keeps too many unreferenced WebGL contexts around before it decides to GC (bug 617453). This patch makes us trigger the GC before every WebGL test page (there are 300 of them) which has proved to solve the problem on tryserver, with 18 green runs without any orange: https://tbpl.mozilla.org/?tree=Try&rev=789cf49fdc63 Failures occured most of the time on 32bit linux-pgo but have been observed on 64bit too, see bug 695947 comment 6. --- .../test_webgl_conformance_test_suite.html | 46 ++++++++++--------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/content/canvas/test/webgl/test_webgl_conformance_test_suite.html b/content/canvas/test/webgl/test_webgl_conformance_test_suite.html index 4dea4fe2771e..881486824ae7 100644 --- a/content/canvas/test/webgl/test_webgl_conformance_test_suite.html +++ b/content/canvas/test/webgl/test_webgl_conformance_test_suite.html @@ -38,6 +38,26 @@ Mochitest version of the WebGL Conformance Test Suite function start() { + var kIsWindows = false; + var kIsMac = false; + var kIsLinux = false; + if (navigator.platform.indexOf("Win") == 0) + kIsWindows = true; + else if (navigator.platform.indexOf("Linux") == 0) + kIsLinux = true; + else if (navigator.platform.indexOf("Mac") == 0) + kIsMac = true; + + var kIsWindowsVistaOrHigher = false; + if (kIsWindows) { + // code borrowed from browser/components/wintaskbar/test/browser_taskbar_preview.js + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); + var version = Components.classes["@mozilla.org/system-info;1"] + .getService(Components.interfaces.nsIPropertyBag2) + .getProperty("version"); + kIsWindowsVistaOrHigher = (parseFloat(version) >= 6.0); + } + function getEnv(env) { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var envsvc = Components.classes["@mozilla.org/process/environment;1"].getService(Components.interfaces.nsIEnvironment); @@ -191,6 +211,10 @@ function start() { Reporter.prototype.startPage = function(url) { dump('WebGL mochitest: starting page ' + url + '\n'); + if (kIsLinux) { + dump('Calling garbageCollect()\n'); + SpecialPowers.DOMWindowUtils.garbageCollect(); + } var page = this.pagesByURL[url]; this.currentPage = page; statusTextNode.textContent = 'Running URL: ' + url; @@ -291,28 +315,6 @@ function start() { SimpleTest.waitForExplicitFinish(); SimpleTest.requestLongerTimeout(3); - var kIsWindows = false; - var kIsMac = false; - var kIsLinux = false; - if (navigator.platform.indexOf("Win") == 0) - kIsWindows = true; - else if (navigator.platform.indexOf("Linux") == 0) - kIsLinux = true; - else if (navigator.platform.indexOf("Mac") == 0) - kIsMac = true; - - var kIsWindowsVistaOrHigher = false; - // we currently disable this test on versions of Windows older than Windows Vista, - // due to failure to load ANGLE on win 2003 test slaves, see bug 582053. - if (kIsWindows) { - // code borrowed from browser/components/wintaskbar/test/browser_taskbar_preview.js - netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - var version = Components.classes["@mozilla.org/system-info;1"] - .getService(Components.interfaces.nsIPropertyBag2) - .getProperty("version"); - kIsWindowsVistaOrHigher = (parseFloat(version) >= 6.0); - } - // we currently disable this test on version of Mac OSX older than 10.6, // due to various weird failures, including one making getRenderbufferParameter tests // on DEPTH_STENCIL fail