Bug 1493560 - Change test to allow another possibility. r=arai a=test-only
authorJason Orendorff <jorendorff@mozilla.com>
Mon, 22 Oct 2018 15:03:20 +0000
changeset 501463 e5f98886a12a
parent 501462 290d09651022
child 501464 8337ebb86a42
push id1873
push userjcristau@mozilla.com
push dateThu, 06 Dec 2018 20:13:42 +0000
treeherdermozilla-release@e5f98886a12a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersarai, test-only
bugs1493560
milestone64.0
Bug 1493560 - Change test to allow another possibility. r=arai a=test-only This also changes the test to print something informative on failure. Differential Revision: https://phabricator.services.mozilla.com/D9046
js/src/jit-test/tests/ion/bug913749.js
--- a/js/src/jit-test/tests/ion/bug913749.js
+++ b/js/src/jit-test/tests/ion/bug913749.js
@@ -5,17 +5,28 @@ Object.defineProperty(x, 18, {
     get: (function() {
         y.length;
     }),
 });
 this.toSource();
 
 y = undefined;
 
+// The exact error message varies nondeterministically. Accept several
+// variations on the theme.
+var variations = [
+    `y is undefined`,
+    `can't access property "length" of undefined` ,
+    `undefined has no properties`,
+];
+
+var hits = 0;
 for (var i = 0; i < 3; i++) {
     try {
-	x.toString();
-	assertEq(0, 1);
+        x.toString();
     } catch (e) {
-	assertEq(e.message === "y is undefined" ||
-		 e.message === `can't access property "length" of undefined`, true);
+        assertEq(e.constructor.name, 'TypeError');
+        if (!variations.includes(e.message))
+            throw new Error(`expected one of ${uneval(variations)}; got ${uneval(e.message)}`);
+        hits++;
     }
 }
+assertEq(hits, 3);