Skip to content
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

Flaky co19/LibTest/async/Future/Future.delayed_A01_t02 #15524

Closed
mkustermann opened this issue Dec 9, 2013 · 5 comments
Closed

Flaky co19/LibTest/async/Future/Future.delayed_A01_t02 #15524

mkustermann opened this issue Dec 9, 2013 · 5 comments
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@mkustermann
Copy link
Member

The test co19/LibTest/async/Future/Future.delayed_A01_t02 looks like this (co19 rev 672):

 20 check(delayms, value) {
 21 Duration delay=durationMs(delayms);
 22 Stopwatch sw=new Stopwatch();
 23 sw.start();
 24 asyncStart();
 25 Future future = new Future.delayed(delay, (){
 26 Duration elapsed=sw.elapsed;
 27 Expect.isTrue(elapsed >= delay, "delay=$delay, elapsed=${elapsed}");
 28 asyncEnd();
 29 });
 30 }
 31
 32 main() {
 33 check(0, 11);
 34 check(300, 3);
 35 check(50, 22);
 36 }

(Note: the second argument to check is ignored)

It seems like this is a legitimate test, it calls Future.delayed() with a "delay" and asserts that the callback is only called after "delay" using a StopWatch.

This test is highly flaky on both the standalone VM and dartium (it surprised me that it's flaky on both, I would expect that standalone VM and dartium have different timer implementations).

Could someone from dartium and someone from dart:io investigate?
[Setting Area-IO, but this is dartium as well]

@floitsch: Maybe you can give some insight into the implementation of Future.delayed?

@mkustermann
Copy link
Member Author

Vm failure (in flaky log):
http://build.chromium.org/p/client.dart/builders/vm-linux-release-be/builds/2050/steps/tests/logs/flakylog

Dartium failure:
build.chromium.org/p/client.dart/builders/dartium-win-full-be/builds/544/steps/dartium_core_unchecked_tests/logs/stdio

@floitschG
Copy link
Contributor

Set owner to @lrhn.

@lrhn
Copy link
Member

lrhn commented Dec 9, 2013

I hope to have fixed the VM timer.
It failed due to stopwatch having millisecond granularity, and the timer rounding the current time down to a millisecond before computing the stop time - so it could fire 0.999 milliseconds early.
The solution is to add one millisecond to the timer duration (which is the same as (the more correct) rounding time up instead of down in 999 out of a 1000 cases).

@andersjohnsen
Copy link

Moving to Dartium, as dart:io should be fixed by now. Re-added test for VM in r31658.


Removed Area-IO label.
Added Area-Dartium label.

@lrhn lrhn removed their assignment Dec 8, 2015
@lrhn
Copy link
Member

lrhn commented Dec 8, 2015

We need a Dartium developer to check if this is still a problem.

@kevmoo kevmoo added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed priority-unassigned labels Feb 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

6 participants