Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(325)

Issue 8418031: Regression tests for two recently-fixed audio-related crashers. (Closed)

Created:
9 years, 1 month ago by Ami GONE FROM CHROMIUM
Modified:
9 years, 1 month ago
CC:
chromium-reviews, hclam+watch_chromium.org, ddorwin+watch_chromium.org, fischman+watch_chromium.org, Paweł Hajdan Jr., acolwell+watch_chromium.org, annacc+watch_chromium.org, ajwong+watch_chromium.org, vrk (LEFT CHROMIUM), scherkus (not reviewing), ihf+watch_chromium.org, enal
Visibility:
Public.

Description

Regression tests for two recently-fixed audio-related crashers. BUG=101228, 101375 TEST=new tests pass locally, trybots

Patch Set 1 : . #

Total comments: 17

Patch Set 2 : . #

Total comments: 13
Unified diffs Side-by-side diffs Delta from patch set Stats (+110 lines, -0 lines) Patch
A chrome/browser/media/media_browsertest.cc View 1 1 chunk +90 lines, -0 lines 13 comments Download
M chrome/chrome_tests.gypi View 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/data/media/seek-jumper.html View 1 1 chunk +19 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Ami GONE FROM CHROMIUM
9 years, 1 month ago (2011-10-28 18:26:06 UTC) #1
Ami GONE FROM CHROMIUM
Eugene: purely FYI.
9 years, 1 month ago (2011-10-28 18:28:18 UTC) #2
scherkus (not reviewing)
nits but LGTM http://codereview.chromium.org/8418031/diff/2001/chrome/browser/media/media_browsertest.cc File chrome/browser/media/media_browsertest.cc (right): http://codereview.chromium.org/8418031/diff/2001/chrome/browser/media/media_browsertest.cc#newcode17 chrome/browser/media/media_browsertest.cc:17: FilePath("media"), FilePath("seek-jumper.html"))) {} indent +2 pedantic ...
9 years, 1 month ago (2011-10-28 21:03:12 UTC) #3
Ami GONE FROM CHROMIUM
http://codereview.chromium.org/8418031/diff/2001/chrome/browser/media/media_browsertest.cc File chrome/browser/media/media_browsertest.cc (right): http://codereview.chromium.org/8418031/diff/2001/chrome/browser/media/media_browsertest.cc#newcode17 chrome/browser/media/media_browsertest.cc:17: FilePath("media"), FilePath("seek-jumper.html"))) {} On 2011/10/28 21:03:13, scherkus wrote: > ...
9 years, 1 month ago (2011-10-28 21:54:28 UTC) #4
Ami GONE FROM CHROMIUM
My inability to get the bots to reliably run these tests made me give up. ...
9 years, 1 month ago (2011-10-31 18:24:56 UTC) #5
Paweł Hajdan Jr.
Drive-by, in which I show you likely reasons why the test is not reliable. Please ...
9 years, 1 month ago (2011-11-02 08:43:26 UTC) #6
Ami GONE FROM CHROMIUM
Thanks for looking, but I think you think the tests are unreliable because I'm being ...
9 years, 1 month ago (2011-11-02 16:32:48 UTC) #7
Paweł Hajdan Jr.
9 years, 1 month ago (2011-11-02 18:18:15 UTC) #8
One note: I _don't_ think it's because timeouts you're using are too short. One
of the reasons TestTimeouts were created was to avoid people trying to increase
custom timeouts slightly to try to fix flakiness. Now we have large enough
timeouts that should work for everyone.

It seems to me the primary reason of problems here is the C++ <-> JS
interaction, and the WaitForSuccess loop. This is non-trivial of couse, but I
thought I'd share my thoughts anyway (in my initial review comments I didn't
really see your note that this change is not being committed for now, so I've
done everything similarly to any other drive-by review).

http://codereview.chromium.org/8418031/diff/1005/chrome/browser/media/media_b...
File chrome/browser/media/media_browsertest.cc (right):

http://codereview.chromium.org/8418031/diff/1005/chrome/browser/media/media_b...
chrome/browser/media/media_browsertest.cc:25: void WaitForSuccess(const
base::Callback<bool(void)>& closure) {
On 2011/11/02 16:32:48, Ami Fischman wrote:
> The events I need to await for are "JS expression becomes true in the page"
(or,
> equivalently, JS method is called in the page)

This is non-trivial, but I think extensions and WebUI teams do something very
similar. Unfortunately I don't know much more. However, this C++ <-> JS
interaction is a very common cause of flakiness if not done with extreme care.

> "browser tab count becomes N".  Can you tell me how to listen
> for them without these effective sleeps?

That's easy! See TabCountChangeObserver and
http://codesearch.google.com/codesearch#OAMlx_jo-ck/src/chrome/browser/chrome...

It may even be useful for you in the future, so I'm glad you asked.

http://codereview.chromium.org/8418031/diff/1005/chrome/browser/media/media_b...
chrome/browser/media/media_browsertest.cc:47:
CHECK(ui_test_utils::ExecuteJavaScriptAndExtractBool(
On 2011/11/02 16:32:48, Ami Fischman wrote:
> 1) Why does a CHECK (as opposed to propagating a gtest failure and ASSERTing
> it's absence in the TEST method) subject the test to a higher risk of
> DISABLEment?  I thought InProcessBrowserTest's were launched in individual
> processes anyway, so a CHECK failure here results in just the calling test
> crashing, and not affecting other tests.

That's true. Now here's the catch: we still want to distinguish between flaky
failures and crashes, so FLAKY and FAILS do not suppress those crashes. Other
tests are indeed not affected, but the only way to green the tree is to DISABLE
the test. Please see also
http://www.chromium.org/developers/tree-sheriffs/sheriff-details-chromium/han...

> 2) The condition being CHECKd for indicates a programming error, so it seems
> reasonable to me to use CHECK (as opposed to missing an expectation of the
test,
> for which I use ASSERT/EXPECT).

For anything in ui_test_utils failing, you can't say for sure it's a programming
error. There are many different reasons those calls can fail, especially those
related to JS and the renderers.

http://codereview.chromium.org/8418031/diff/1005/chrome/browser/media/media_b...
chrome/browser/media/media_browsertest.cc:85: // Give the renderer a bit of time
to crash.  Sad but necessary.
On 2011/11/02 16:32:48, Ami Fischman wrote:
> I feel like you have a magic cure but you're holding it behind your back,
> waiting for me to guess :)

Not exactly, but yeah, I was working on this issue and just wanted to keep my
initial comment short. I'm glad you're interested in the real answer.

> How would you implement this on POSIX?

Take a look at InitialLoadObserver and
content::NOTIFICATION_RENDERER_PROCESS_CLOSED. One note: you should then
probably check the details to see if it was a crash. You can then use
WindowedNotificationObserver to wait for the notification.

> How would you fix this on Windows?

Same way, but I think there is a bug that results in
NOTIFICATION_RENDERER_PROCESS_CLOSED not being called in some circumstances
(when the renderer crashes before connecting to the IPC channel). Actually this
test doesn't seem to be affected by that bug.

http://codereview.chromium.org/8418031/diff/1005/chrome/browser/media/media_b...
chrome/browser/media/media_browsertest.cc:87: FROM_HERE, new
MessageLoop::QuitTask(), 2000);
On 2011/11/02 16:32:48, Ami Fischman wrote:
> On 2011/11/02 08:43:27, Paweł Hajdan Jr. wrote:
> > No hardcoded timeouts please.
> 
> Have you looked at the bugs that these tests are regression-testing?  I'm
happy
> to hear concrete suggestions you have for improvements.

I've read the bugs now. I think my comment about this still makes sense. On
Valgrind you'll execute much less iterations in 2 s than without it. With
TestTimeouts this time would be automatically adjusted for you when executing in
a slower environment.

Powered by Google App Engine
This is Rietveld 408576698