Bug 482598 - Requesting a tinderbox for Mac with --enable-accessibility; (Bv1) Force a leak threshold for test suite; r=jwalden+bmo
authorSerge Gautherie <sgautherie.bz@free.fr>
Tue, 21 Apr 2009 00:26:03 +0200
changeset 27554 343a046740771b6b7b8f9b5645001ae79f3c15d1
parent 27553 8f5ce95d8ad89f884a61a3611d8d262262d2cefd
child 27555 fbfbc1e04f4ee344295e3404045461cffde22eaa
push id6609
push usersgautherie.bz@free.fr
push dateMon, 20 Apr 2009 22:34:58 +0000
treeherdermozilla-central@fbfbc1e04f4e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden
bugs482598
milestone1.9.2a1pre
Bug 482598 - Requesting a tinderbox for Mac with --enable-accessibility; (Bv1) Force a leak threshold for test suite; r=jwalden+bmo
build/automation.py.in
testing/mochitest/runtests.py.in
--- a/build/automation.py.in
+++ b/build/automation.py.in
@@ -56,16 +56,17 @@ for setting up the browser environment.
 """
 
 SCRIPT_DIR = os.path.abspath(os.path.realpath(os.path.dirname(sys.argv[0])))
 
 __all__ = [
            "UNIXISH",
            "IS_WIN32",
            "IS_MAC",
+           "log",
            "runApp",
            "Process",
            "initializeProfile",
            "DIST_BIN",
            "DEFAULT_APP",
            "CERTS_SRC_DIR",
            "environment",
            "dumpLeakLog",
--- a/testing/mochitest/runtests.py.in
+++ b/testing/mochitest/runtests.py.in
@@ -37,17 +37,16 @@
 #
 # ***** END LICENSE BLOCK *****
 
 """
 Runs the Mochitest test harness.
 """
 
 from datetime import datetime
-import logging
 import optparse
 import os
 import os.path
 import sys
 import time
 import shutil
 from urllib import quote_plus as encodeURIComponent
 import urllib2
@@ -78,18 +77,16 @@ SERVER_STARTUP_TIMEOUT = 45
 oldcwd = os.getcwd()
 SCRIPT_DIRECTORY = os.path.abspath(os.path.realpath(os.path.dirname(sys.argv[0])))
 os.chdir(SCRIPT_DIRECTORY)
 
 PROFILE_DIRECTORY = os.path.abspath("./mochitesttestingprofile")
 
 LEAK_REPORT_FILE = PROFILE_DIRECTORY + "/" + "leaks-report.log"
 
-log = logging.getLogger()
-
 # Map of debugging programs to information about them, like default arguments
 # and whether or not they are interactive.
 DEBUGGER_INFO = {
   # gdb requires that you supply the '--args' flag in order to pass arguments
   # after the executable name to the executable.
   "gdb": {
     "interactive": True,
     "args": "-q --args"
@@ -268,34 +265,34 @@ class MochitestServer:
   def start(self):
     "Run the Mochitest server, returning the process ID of the server."
     
     env = dict(os.environ)
     if automation.UNIXISH:
       env["LD_LIBRARY_PATH"] = self._xrePath
       env["MOZILLA_FIVE_HOME"] = self._xrePath
       env["XPCOM_DEBUG_BREAK"] = "warn"
-    if automation.IS_MAC:
+    elif automation.IS_MAC:
       env["DYLD_LIBRARY_PATH"] = self._xrePath
     elif automation.IS_WIN32:
       env["PATH"] = env["PATH"] + ";" + self._xrePath
 
     args = ["-g", self._xrePath,
             "-v", "170",
             "-f", "./" + "httpd.js",
             "-f", "./" + "server.js"]
 
     xpcshell = os.path.join(self._utilityPath,
                             "xpcshell" + automation.BIN_SUFFIX)
     self._process = automation.Process([xpcshell] + args, env = env)
     pid = self._process.pid
     if pid < 0:
       print "Error starting server."
       sys.exit(2)
-    log.info("Server pid: %d", pid)
+    automation.log.info("INFO | runtests.py | Server pid: %d", pid)
     
 
   def ensureReady(self, timeout):
     assert timeout >= 0
 
     aliveFile = os.path.join(PROFILE_DIRECTORY, "server_alive.txt")
     i = 0
     while i < timeout:
@@ -443,16 +440,21 @@ Are you executing $objdir/_tests/testing
   if options.chrome:
     testURL = CHROMETESTS_URL
     if options.testPath:
       urlOpts.append("testPath=" + encodeURIComponent(options.testPath))
   elif options.a11y:
     testURL = A11YTESTS_URL
     if options.testPath:
       urlOpts.append("testPath=" + encodeURIComponent(options.testPath))
+    # Force leak threshold. (bug 472773)
+    if automation.IS_MAC and options.leakThreshold == 0:
+      options.leakThreshold = 68
+      automation.log.info("INFO | runtests.py | setting leak threshold to %d",
+                          options.leakThreshold)
   elif options.browserChrome:
     testURL = "about:blank"
 
   # allow relative paths for logFile
   if options.logFile:
     options.logFile = getFullPath(options.logFile)
   if options.browserChrome:
     makeTestConfig(options)