js/dom/Promise.html is flaky, frequently failing in debug builds. Not sure if it's a test deficiency, or a legitimate bug. About to run test - promiseAsync PASS foo is foo PASS foo is foo PASS foo is foo FAIL foo should be bar
Marked as flaky in <http://trac.webkit.org/r177865>.
Are promise and setTimeout timers on different event queues? function promiseAsync() { var global = "foo"; var f = new Promise(function(r1, r2) { is(global, "foo", "Global should be foo"); r1(42); is(global, "foo", "Global should still be foo"); setTimeout(function() { is(global, "bar", "Global should still be bar!"); runTest(); }, 0); }).then(function() { global = "bar"; }); is(global, "foo", "Global should still be foo (2)"); }
(In reply to comment #2) > Are promise and setTimeout timers on different event queues? They are...kind of.
(In reply to comment #3) > (In reply to comment #2) > > Are promise and setTimeout timers on different event queues? > > They are...kind of. I don't think anything in our implementation ensures this ordering, but it really should. This is a great example of why it would be great if we have a unified event loop mechanism. In this case, the bug is that the .then() should run at the next microtask checkpoint, which is defined as being before the next chance for a timer to fire. Our implementation of Promises does not use the microtask checkpoint, but rather uses ScriptExecutionContext::postTask() mechanism, which is not quite the same thing.
The test is also flaky on release, so I removed the debug flag in http://trac.webkit.org/projects/webkit/changeset/210898 https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=js%2Fdom%2FPromise.html