New issue
Advanced search Search tips

Issue 624555 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

Flaky test on Mac - RunMenuAndCancel

Project Member Reported by petewil@chromium.org, Jun 29 2016

Issue description

Sheriff is disabling the test, it needs to be fixed.

This test has been flaky since about 21:49 (PDST) on Jun 28th.

Build where the test failed:
https://build.chromium.org/p/chromium.memory/builders/Mac%20ASan%2064%20Tests%20%281%29/builds/18166

Sample log data from failure:

[ RUN      ] MenuRunnerCocoaTest.RunMenuAndCancel
../../ui/views/controls/menu/menu_runner_cocoa_unittest.mm:181: Failure
Expected: (runner_->GetClosingEventTime()) <= (ui::EventTimeForNow()), actual: 9760625518 bogo-microseconds vs 2000 bogo-microseconds
[  FAILED  ] MenuRunnerCocoaTest.RunMenuAndCancel (55 ms)

==54709==ERROR: AddressSanitizer: heap-use-after-free on address 0x61600004de58 at pc 0x0001084784f3 bp 0x7fff59286bb0 sp 0x7fff59286ba8
READ of size 8 at 0x61600004de58 thread T0
LLVMSymbolizer: error reading file: No such file or directory
    #0 0x1084784f2 in
Traceback (most recent call last):
  File "/b/swarm_slave/work/isolated/isolated_runyNxCPO/tools/valgrind/asan/asan_symbolize.py", line 271, in <module>
    main()
  File "/b/swarm_slave/work/isolated/isolated_runyNxCPO/tools/valgrind/asan/asan_symbolize.py", line 268, in main
    loop.process_logfile()
  File "/b/swarm_slave/work/isolated/isolated_runyNxCPO/tools/valgrind/asan/third_party/asan_symbolize.py", line 416, in process_logfile
    processed = self.process_line(line)
  File "/b/swarm_slave/work/isolated/isolated_runyNxCPO/tools/valgrind/asan/third_party/asan_symbolize.py", line 439, in process_line_posix
    symbolized_line = self.symbolize_address(addr, binary, offset)
  File "/b/swarm_slave/work/isolated/isolated_runyNxCPO/tools/valgrind/asan/third_party/asan_symbolize.py", line 393, in symbolize_address
    result = symbolizers[binary].symbolize(addr, binary, offset)
  File "/b/swarm_slave/work/isolated/isolated_runyNxCPO/tools/valgrind/asan/third_party/asan_symbolize.py", line 244, in symbolize
    result = symbolizer.symbolize(addr, binary, offset)
  File "/b/swarm_slave/work/isolated/isolated_runyNxCPO/tools/valgrind/asan/third_party/asan_symbolize.py", line 216, in symbolize
    atos_line = self.atos.convert('0x%x' % int(offset, 16))
  File "/b/swarm_slave/work/isolated/isolated_runyNxCPO/tools/valgrind/asan/third_party/asan_symbolize.py", line 192, in convert
    self.w.write(line + "\n")
IOError: [Errno 5] Input/output error
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 29 2016

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

commit 9ddab90484c989becaebaac4f789bbebb382adbc
Author: petewil <petewil@chromium.org>
Date: Wed Jun 29 23:07:33 2016

Disable flaky RunMenuAndCancel test.

BUG= 624555 

Sheriff: This test has been failing off an on for almost a day.
Time to turn off the test and fix it.

TBR=sky@chromium.org

Review-Url: https://codereview.chromium.org/2110253002
Cr-Commit-Position: refs/heads/master@{#402978}

[modify] https://crrev.com/9ddab90484c989becaebaac4f789bbebb382adbc/ui/views/controls/menu/menu_runner_cocoa_unittest.mm

Components: Internals>Views
Labels: Proj-MacViews OS-Mac
Status: Assigned (was: Untriaged)

Comment 3 by tapted@chromium.org, Jun 30 2016

Cc: karandeepb@chromium.org
Components: Tests>Flaky
Labels: -Pri-3 M-53 Pri-1
Owner: tapted@chromium.org
Status: Started (was: Assigned)
I've got this one - https://codereview.chromium.org/2094193002/ - unless you're further than me already :)

I think it's some weird global state issue -- EventGenerator sets a mock time source, but doesn't clear it when it's destroyed. So depending on the order tests run, some prior test may have mucked around with the clock.

Either we should use ui::EventTimeForNow() in menu runner cocoa impl, or we should NOT use it in the test. But I also want to get the the root cause on why this mock time source is sticking around (assuming that's actually it).
Nah, hadn't started looked at it. 
Project Member

Comment 5 by bugdroid1@chromium.org, Jul 1 2016

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

commit 80f15fe17e9095bd4d6c11d94db8e1dd42556458
Author: tapted <tapted@chromium.org>
Date: Fri Jul 01 00:36:49 2016

Deflake Mac views_unittest's MenuRunnerCocoaTest.RunMenuAndCancel

The test occasionally fails with

menu_runner_cocoa_unittest.mm:182: Failure
Expected: (runner_->GetClosingEventTime())
    <= (ui::EventTimeForNow() - base::TimeTicks())),
actual: 13647.4s vs 0.002s

It happens because menu_runner_impl_cocoa.mm uses
base::TimeTicks::Now(), but the test uses ui::EventTimeForNow() to set
expectations. Usually this isn't a problem, but if another unit test in
the same process has created a ui::EventGenerator, this sets a mock time
source with ui::SetEventTickClockForTesting(..) which isn't cleared when
the EventGenerator is destroyed.

Fix both problems. The EventGenerator destructor should reset the global
state it created, and menu_runner_impl_cocoa.mm should use
ui::EventTimeForNow() for better consistency.

BUG= 623455 ,  624555 

Review-Url: https://codereview.chromium.org/2094193002
Cr-Commit-Position: refs/heads/master@{#403373}

[modify] https://crrev.com/80f15fe17e9095bd4d6c11d94db8e1dd42556458/ui/events/test/event_generator.cc
[modify] https://crrev.com/80f15fe17e9095bd4d6c11d94db8e1dd42556458/ui/views/controls/menu/menu_runner_cocoa_unittest.mm
[modify] https://crrev.com/80f15fe17e9095bd4d6c11d94db8e1dd42556458/ui/views/controls/menu/menu_runner_impl_cocoa.mm

Status: Fixed (was: Started)

Sign in to add a comment