Q: Why do we care about flaky layout tests?
A: They cost us time. Specfically, they cause the commit-queue to reject good patches, lead engineers to spend extra time spent determining if they caused the tree to go red, mask real regressions because the tree was already red, put an extra burden on ports trying to determine if their port is bad or the test is just bad, etc.
Q: How can I help fix flaky tests/not introduce more flaky tests?
A: One big, easily fixable, source of flakiness is setTimeouts. Whenever possible, use specific events rather than relying on setTimeouts. Don't use setTimeout to wait for resources to load. Use onload events instead (iframe, image, body all have onload events). If there are no events possible, and you need time to elapse before checking something, provide a little extra wiggle room.
Q: Do you have examples of these sorts of easy fixes?