Bug 1369807 - disable platform microbenchmarks on Linux r?jmaher, wlach; try: -b do -p linux,linux64,macosx64,win32,win64 -u cppunit,gtest -t other-e10s draft
authorIonut Goldan <ionut.goldan@softvision.ro>
Mon, 24 Jul 2017 16:17:47 +0300
changeset 1195493 23d771dd2953
parent 1190247 eb1d92b2b6a4
child 1254320 56cda1a0a97a
push id207643
push userionut.goldan@softvision.ro
push dateTue, 25 Jul 2017 08:05:11 +0000
treeherdertry@23d771dd2953 [default view] [failures only]
reviewersjmaher, wlach, try
bugs1369807
milestone56.0a1
Bug 1369807 - disable platform microbenchmarks on Linux r?jmaher, wlach; try: -b do -p linux,linux64,macosx64,win32,win64 -u cppunit,gtest -t other-e10s MozReview-Commit-ID: 8srIIdVUrMo
testing/gtest/mozilla/MozGTestBench.cpp
testing/gtest/rungtests.py
--- a/testing/gtest/mozilla/MozGTestBench.cpp
+++ b/testing/gtest/mozilla/MozGTestBench.cpp
@@ -10,30 +10,32 @@
 #define MOZ_GTEST_BENCH_FRAMEWORK "platform_microbench"
 
 using mozilla::TimeStamp;
 
 namespace mozilla {
 void GTestBench(const char* aSuite, const char* aName,
                 const std::function<void()>& aTest)
 {
+  bool shouldAlert = bool(getenv("PERFHERDER_ALERTING_ENABLED"));
+
 #ifdef DEBUG
   // Run the test to make sure that it doesn't fail but don't log
   // any measurements since it's not an optimized build.
   aTest();
 #else
   mozilla::TimeStamp start = TimeStamp::Now();
 
   aTest();
 
   int msDuration = (TimeStamp::Now() - start).ToMicroseconds();
 
   // Print the result for each test. Let perfherder aggregate for us
   printf("PERFHERDER_DATA: {\"framework\": {\"name\": \"%s\"}, "
-                           "\"suites\": [{\"name\": \"%s\", \"subtests\": "
-                               "[{\"name\": \"%s\", \"value\": %i, \"lowerIsBetter\": true}]"
-                           "}]}\n",
-                           MOZ_GTEST_BENCH_FRAMEWORK, aSuite, aName, msDuration);
+                       "\"suites\": [{\"name\": \"%s\", \"subtests\": "
+                           "[{\"name\": \"%s\", \"value\": %i, \"lowerIsBetter\": true, \"shouldAlert\": %s}]"
+                       "}]}\n",
+                       MOZ_GTEST_BENCH_FRAMEWORK, aSuite, aName, msDuration, shouldAlert ? "true" : "false");
 #endif
 }
 
 } // mozilla
 
--- a/testing/gtest/rungtests.py
+++ b/testing/gtest/rungtests.py
@@ -107,19 +107,22 @@ class GTests(object):
         """
         Create and return a dictionary of all the appropriate env variables and values.
         On a remote system, we overload this to set different values and are missing things like os.environ and PATH.
         """
         if not os.path.isdir(self.xre_path):
             raise Exception("xre_path does not exist: %s", self.xre_path)
         env = dict(os.environ)
         env = self.build_core_environment(env)
+        env["PERFHERDER_ALERTING_ENABLED"] = 1
         pathvar = ""
         if mozinfo.os == "linux":
             pathvar = "LD_LIBRARY_PATH"
+            # disable alerts for unstable tests (Bug 1369807)
+            env["PERFHERDER_ALERTING_ENABLED"] = 0
         elif mozinfo.os == "mac":
             pathvar = "DYLD_LIBRARY_PATH"
         elif mozinfo.os == "win":
             pathvar = "PATH"
         if pathvar:
             if pathvar in env:
                 env[pathvar] = "%s%s%s" % (self.xre_path, os.pathsep, env[pathvar])
             else: