Summary: | Several JavaScriptCore date tests are flaky, because they expect time to be frozen during execution | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Alexey Proskuryakov <ap> | ||||
Component: | Tools / Tests | Assignee: | Alexey Proskuryakov <ap> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | ggaren, mark.lam | ||||
Priority: | P2 | Keywords: | MakingBotsRed | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Alexey Proskuryakov
2014-12-01 11:24:49 PST
This is a whole lot of flakiness for tests that do pretty much nothing (all they verify is that arguments are ignored!) Looks like Mozilla folks fixed this long ago: <https://bugzilla.mozilla.org/show_bug.cgi?id=404351>. Created attachment 242328 [details]
proposed fix
Manually merged the fix, because our version of shell.js is obsolete even compared to what Mozilla had in 2007. Perhaps we should update to trunk? I actually tried that just for laughs, but it wasn't easy enough.
Comment on attachment 242328 [details] proposed fix View in context: https://bugs.webkit.org/attachment.cgi?id=242328&action=review > Source/JavaScriptCore/tests/mozilla/ecma/Date/15.9.2.2-2.js:72 > + array[item++] = new TestCase( SECTION, "Date(2000,0,1,0,0,0)", true, d2 - d1 <= 1000); I was concerned about all the copy and pasting, and was wondering if it is better to write a utility function to eliminate the cut and paste like so: function makeTestCase(dateExpr) { var d1 = new Date(); var d2 = eval(dateExpr); return new TestCase(SECTION, dateExpr, true, d2 - d1 <= 1000); } array[item++] = makeTestCase("Date(2000,0,1,0,0,0)"); Here, we're seeing a discrepancy between the reported and the evaluated expressions. I see that the discrepancy is also in the original test code (which is a bug). Regardless, I think it'd be better to use a utility function instead. > Source/JavaScriptCore/tests/mozilla/ecma/Date/15.9.2.2-2.js:76 > + array[item++] = new TestCase( SECTION, "Date(2000,0,1,0,0,1)", true, d2 - d1 <= 1000) Ditto. Another discrepancy. Comment on attachment 242328 [details]
proposed fix
r=me for the sake of keeping the test code consistent with Mozilla's and easily mergeable. However, please fix the 2 discrepancies. That shouldn't make merging that much harder in the future. Thanks.
Committed <http://trac.webkit.org/r176601>. |