Bug 1390964 - Do not clobber an existing LD_LIBRARY_PATH in the mochitest harness. r=ted draft
authorBotond Ballo <botond@mozilla.com>
Wed, 16 Aug 2017 13:25:01 -0400
changeset 647802 2383db7abceea790dbb837ddfa501626492159b4
parent 645963 6213fec03a47275d8fcbf79b951547e3993d677f
child 647803 2ac9f7e799437b9242cc03ec93f0fb1895b0a8f2
push id74543
push userbballo@mozilla.com
push dateWed, 16 Aug 2017 23:13:38 +0000
reviewersted
bugs1390964
milestone57.0a1
Bug 1390964 - Do not clobber an existing LD_LIBRARY_PATH in the mochitest harness. r=ted MozReview-Commit-ID: 7uQ71Jpq1lM
testing/mochitest/runtests.py
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -412,17 +412,20 @@ class MochitestServer(object):
         self._httpdPath = os.path.abspath(self._httpdPath)
 
     def start(self):
         "Run the Mochitest server, returning the process ID of the server."
 
         # get testing environment
         env = test_environment(xrePath=self._xrePath, log=self._log)
         env["XPCOM_DEBUG_BREAK"] = "warn"
-        env["LD_LIBRARY_PATH"] = self._xrePath
+        if "LD_LIBRARY_PATH" not in env or env["LD_LIBRARY_PATH"] is None:
+            env["LD_LIBRARY_PATH"] = self._xrePath
+        else:
+            env["LD_LIBRARY_PATH"] = ":".join([self._xrePath, env["LD_LIBRARY_PATH"]])
 
         # When running with an ASan build, our xpcshell server will also be ASan-enabled,
         # thus consuming too much resources when running together with the browser on
         # the test slaves. Try to limit the amount of resources by disabling certain
         # features.
         env["ASAN_OPTIONS"] = "quarantine_size=1:redzone=32:malloc_context_size=5"
 
         # Likewise, when running with a TSan build, our xpcshell server will