New issue
Advanced search Search tips

Issue 734232 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Fuchsia
Pri: 3
Type: Bug

Blocking:
issue 706592



Sign in to add a comment

WatchdogTest.DisarmTest sometimes fails on Fuchsia

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

Issue description

[00310.034] 02425.02552> [ RUN      ] WatchdogTest.DisarmTest
[00310.034] 02425.02552> ../../base/threading/watchdog_unittest.cc:136: Failure
[00310.034] 02425.02552> Expected: ((base::TimeTicks::Now() - start).InMilliseconds()) <= (kTimeout.InMilliseconds()), actual: 300046 vs 300000
[00310.034] 02425.02552> Timed out
[00310.034] 02425.02552> ../../base/threading/watchdog_unittest.cc:138: Failure
[00310.034] 02425.02552>       Expected: 1
[00310.034] 02425.02552> To be equal to: watchdog.alarm_counter()
[00310.034] 02425.02552>       Which is: 0
[00310.034] 02425.02552> [  FAILED  ] WatchdogTest.DisarmTest (301148 ms)


Seems similar to  bug 734130 ,  bug 734218 ,  bug 734216 .
 
Ah, this one is a bit sneaky.

TimeTicks is a uint64_t.

The test tries to set an alarm for 10s ago. Because the Fuchsia tests are run in a freshly created VM, when it tries to do

  ArmAtStartTime(TimeTicks::Now() - time_delta);

where time_delta is 10s, if the VM hasn't been running for very long, then TimeTicks::Now() < time_delta, resulting in a very large wait time.

Cc: m...@chromium.org
Owner: scottmg@chromium.org
Status: Started (was: Untriaged)
Oh, actually TimeTicks is int64_t, even though mx_time_t is uint64_t.

But, when the watchdog time gets armed for approximately -9s (i.e. start_time_ of -9s here https://cs.chromium.org/chromium/src/base/threading/watchdog.cc?rcl=1a947b509b80615967ccdc266ba06ffd7eaf4dbe&l=98

then in the main wakeup thread https://cs.chromium.org/chromium/src/base/threading/watchdog.cc?rcl=1a947b509b80615967ccdc266ba06ffd7eaf4dbe&l=134 it thinks it's really late so the hung-in-a-debugger path kicks in

  static_data->last_debugged_alarm_time > watchdog_->start_time_

and the alarm is disarmed and ignored, rather than triggered and disarmed. I think the correct fix is probably to initialize last_debugged_alarm_time to int64_t::min, rather than 0.

+miu might be interested in this behaviour.
Status: Fixed (was: Started)
Fixed by https://chromium-review.googlesource.com/c/539058/ when bugdroid was on vacation.

Sign in to add a comment