-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
co19/LibTest/async/Timer/Timer.periodic_A02_t01 is flaky #2471
Comments
It's flaky on multiple configs: https://dart-ci.web.app/#showLatestFailures=false&test=co19/LibTest/async/Timer/Timer.periodic_A02_t01 Also went to failing today on Windows.
I think the test is too strict, the documentation mentions:
The only thing from the documentation we can rely on is:
However, this test calls it with @lrhn What should I think if we say duration 0 is equal duration 0.000000000000001, we still can't write a meaningfull test, because we can only test that the maximum number of callbacks below infinite. |
A Can maybe even start a timer with a non-zero delay, the check that at least one zero-duration timer event happens before that. (Maybe more. Maybe not, depending on other delays, and how we actually schedule - which should be scheduling another timer after the previous one has run, which may or may not be after the non-zero timer was due.) I believe a negative duration counts as a zero duration. (That was probably a mistake, but it is what we have, and it's also not worth changing/breaking.) The one thing we (try to) promise with timers is that they're never early. If they are early, it's due to rounding of timers (asking for a delay of 0.100893 seconds, which The other thing we do, if there are fewer than N ticks, is to increment the We can't say anything about the absolute timing, only that each callback is definitely a timer event, and the next callback shouldn't happen before any other timer event which was already due when the current callback was called (and likely when it returned). So, basically, a Since it's hard to know for sure which events are definitely due, there are limits to how precisely this can be tested, but some things should be possible. |
That said, in this case, which is a simlulated CPU, we probably just need to increase the safety margin. Which make the test rather meaningless. So I'd change it to check that whenever it triggers, it triggers no earlier than a previously scheduled zero-timer event, no earlier than any currently or later scheduled microtasks, and earlier than a later scheduled zero or non-zero timer. Without actual precise timing (which on a simulated CPU can become stale very quickly), it's hard to know anything else. |
Thanks for the input, I just landed #2472. |
2024-01-12 sgrekhov22@gmail.com Fixes dart-lang/co19#2480. Fix typos, add issue numbers (dart-lang/co19#2481) 2024-01-10 sgrekhov22@gmail.com dart-lang/co19#2477. Rename and reorder existing constants tests for match operators before adding new ones (dart-lang/co19#2478) 2024-01-10 sgrekhov22@gmail.com dart-lang/co19#2420. Add null-check-pattern tests for extension types (dart-lang/co19#2475) 2024-01-10 sgrekhov22@gmail.com dart-lang/co19#2119. Add missing experimental flags (dart-lang/co19#2474) 2024-01-10 sgrekhov22@gmail.com dart-lang/co19#2119. Fix typo and improve error messages in Timer tests (dart-lang/co19#2473) 2024-01-09 sgrekhov22@gmail.com Fixes dart-lang/co19#2471. Fix timer constructor tests. Add check for microtasks (dart-lang/co19#2472) 2024-01-09 sgrekhov22@gmail.com Fixes dart-lang/co19#2428. Add `call` member tests for extension types (dart-lang/co19#2438) 2024-01-09 sgrekhov22@gmail.com Fixes dart-lang/co19#2449. Update positions of analyzer expected errors (dart-lang/co19#2450) 2024-01-09 sgrekhov22@gmail.com Fixes dart-lang/co19#2440. Add asyncStart/End() to Stream interface tests (dart-lang/co19#2457) 2024-01-09 sgrekhov22@gmail.com dart-lang/co19#2420. Add another variable pattern exhaustiveness test (dart-lang/co19#2469) 2024-01-08 sgrekhov22@gmail.com dart-lang/co19#2420. Add constant pattern exhaustiveness tests (dart-lang/co19#2467) 2024-01-08 sgrekhov22@gmail.com dart-lang/co19#2436. Add expected constant evaluation error for CFE (dart-lang/co19#2470) 2024-01-08 sgrekhov22@gmail.com dart-lang/co19#2420. Add null-assert pattern exhaustiveness tests (dart-lang/co19#2468) 2024-01-05 sgrekhov22@gmail.com dart-lang/co19#2420. Add parenthesized pattern exhaustiveness tests (dart-lang/co19#2464) Change-Id: I86862732cca7c042120bf312403279c2cc10c135 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345960 Reviewed-by: Alexander Thomas <athom@google.com> Commit-Queue: Erik Ernst <eernst@google.com> Reviewed-by: Erik Ernst <eernst@google.com>
The tests
are failing on configurations
The test went from flaky to failing. From the log, it seems like a duration is slightly longer than expected. So it will probably revert to flaky again.
The text was updated successfully, but these errors were encountered: