New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 738001 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Fuchsia
Pri: 1
Type: Bug

Blocking:
issue 706592
issue 738275



Sign in to add a comment

MessageLoopTestTypeIO.PostDelayedTask_Basic flakes on Fuchsia

Project Member Reported by scottmg@chromium.org, Jun 29 2017

Issue description

https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Fchromium.fyi%2FFuchsia%2F5665%2F%2B%2Frecipes%2Fsteps%2Fbase_unittests%2F0%2Fstdout

[00063.454] 02378.02581> [ RUN      ] MessageLoopTestTypeIO.PostDelayedTask_Basic
[00063.454] 02378.02581> ../../base/message_loop/message_loop_test.cc:144: Failure
[00063.454] 02378.02581> Expected: (kDelay) < (time_after_run - time_before_run), actual: 0.1 s vs 0.087427 s

The test looks fairly reasonable:

https://cs.chromium.org/chromium/src/base/message_loop/message_loop_test.cc?rcl=c1ddec34b40c28a89bea7e53eea719e62d6d3df3&l=136

Maybe the Fuchsia message pump is starting the delay count too soon somehow.
 

Comment 1 by w...@chromium.org, Jul 15 2017

Components: Internals>PlatformIntegration

Comment 2 by w...@chromium.org, Jul 18 2017

Cc: scottmg@chromium.org
Owner: w...@chromium.org
Looking into this this week, since it seems to be present in all of our failed runs.

Comment 3 by w...@chromium.org, Jul 18 2017

Labels: -Pri-3 M-61 Pri-1

Comment 4 by w...@chromium.org, Jul 18 2017

Labels: -M-61 M-62

Comment 5 by w...@chromium.org, Jul 18 2017

Values from some other instances of this failure:

[00078.590] 02440.02674> Expected: (kDelay) < (time_after_run - time_before_run), actual: 0.1 s vs 0.099203 s

[00077.734] 02701.02822> Expected: (kDelay) < (time_after_run - time_before_run), actual: 0.1 s vs 0.093372 s

[00069.129] 02442.02662> Expected: (kDelay) < (time_after_run - time_before_run), actual: 0.1 s vs 0.082505 s

It appears that these tests use wall-clock time to verify the behaviour of PostDelayedTask, whereas implementations these days are tick-clock based.

Comment 6 by w...@chromium.org, Jul 18 2017

Blocking: 738275
Project Member

Comment 7 by bugdroid1@chromium.org, Jul 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/da38b0631b91be6fccdd22a27f712597cbb075e0

commit da38b0631b91be6fccdd22a27f712597cbb075e0
Author: Wez <wez@chromium.org>
Date: Tue Jul 18 17:19:46 2017

Replace Time with TimeTicks in MessageLoop tests.

PostDelayedTask_Basic verifies that the call waits at least as long as
the requested delay, but was using wall-clock time to verify this,
rather than the tick-clock that PostDelayedTask itself should use.

Bug:  738001 , 738275
Change-Id: Ia12423ae46646a348932a8eff6dd1c4e8047fdb7
Reviewed-on: https://chromium-review.googlesource.com/575788
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487512}
[modify] https://crrev.com/da38b0631b91be6fccdd22a27f712597cbb075e0/base/message_loop/message_loop_test.cc
[modify] https://crrev.com/da38b0631b91be6fccdd22a27f712597cbb075e0/base/task_runner.h

Comment 8 by w...@chromium.org, Jul 18 2017

Status: Fixed (was: Started)
Project Member

Comment 9 by bugdroid1@chromium.org, Jul 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/241c1dc966603c7a2db0cc4644e0488f6d606517

commit 241c1dc966603c7a2db0cc4644e0488f6d606517
Author: Scott Graham <scottmg@chromium.org>
Date: Tue Jul 25 03:42:32 2017

Fix PostDelayedTask test timing check

The test code is assuming that the delay is relative to the beginning of
the message loop Run(), but it's actually relative to when the task is
posted per the call to CalculateDelayedRuntime() in
AddToIncomingQueue().

This was exposed on Fuchsia when running on a slow QEMU, but in theory
is all-platforms.

Ref:
https://cs.chromium.org/chromium/src/base/message_loop/incoming_task_queue.cc?rcl=d5968b33fed15b4364fdb44acfa491bbc65ad035&l=75

Bug:  747737 ,  738001 , 738275
Change-Id: If98e0ef3e81777f678f543474194e1fa2f667e2c
Reviewed-on: https://chromium-review.googlesource.com/584029
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#489216}
[modify] https://crrev.com/241c1dc966603c7a2db0cc4644e0488f6d606517/base/message_loop/message_loop_test.cc

Sign in to add a comment