New issue
Advanced search Search tips

Issue 668700 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug
Team-Security-UX

Blocking:
issue 658125



Sign in to add a comment

MediaTest#testMicrophonePersistenceOffDialog is flaky

Project Member Reported by joh...@chromium.org, Nov 25 2016

Issue description

Test org.chromium.chrome.browser.permissions.MediaTest#testMicrophonePersistenceOffDialog is the 2nd flakiest test on https://test-results.appspot.com/dashboards/flakiness_dashboard.html#testType=chrome_public_test_apk&builder=chromium.android%3ALollipop%20Phone%20Tester and is causing builds to go red by failing multiple retries in a row.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Nov 25 2016

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

commit a70629e5ddc767a972c9c5789da4d330a2fcd1a7
Author: johnme <johnme@chromium.org>
Date: Fri Nov 25 14:59:19 2016

[permissions.MediaTest] Mark testMicrophonePersistenceOffDialog flaky

TBR=dominickn@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= 668700 , 658125 

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

[modify] https://crrev.com/a70629e5ddc767a972c9c5789da4d330a2fcd1a7/chrome/android/javatests/src/org/chromium/chrome/browser/permissions/MediaTest.java

Strange, this test should be no more flaky than MediaTest#testCombinedPersistenceOffDialog, which isn't flaky at all:

https://test-results.appspot.com/dashboards/flakiness_dashboard.html#testType=chrome_public_test_apk&tests=MediaTest%23testCombinedPersistenceOffDialog

The tests only differ in that combined is calling for mic + camera.

Comment 3 by joh...@chromium.org, Nov 28 2016

The arguments differ. testMicrophonePersistenceOffDialog calls testMediaPermissionsPlumbing with true,true,true,true whereas testCombinedPersistenceOffDialog calls it with false,false,true,true. Since the 2nd argument is called "isDialog", it looks like testCombinedPersistenceOffDialog is incorrect and should be passing true instead?
Aha, good catch. That's definitely a mistake.

I've investigated more and the test flakes because it hangs waiting for a switch to be toggled. My hypothesis is that the synthetic touch event used to trigger the switch might be getting to it before the switch is ready.

I'm going to see if I can just programmatically toggle the switch. That should resolve the flakiness.
Project Member

Comment 5 by bugdroid1@chromium.org, Nov 29 2016

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

commit c6f2275d2d7d1db5d194f46b4d08e37ebb2769b5
Author: dominickn <dominickn@chromium.org>
Date: Tue Nov 29 20:41:53 2016

Deflake permission dialog + persistence toggle tests on Android.

These tests would flake through timing out while waiting for a switch to
be toggled. The toggle was triggered through a synthetic touch event
sent to the switch view. Observing the flake would reveal that the
switch stayed in its original position after the touch event was sent,
so the hypothesis is that the touch event was sent prior to the view
being ready to respond to it.

This CL deflakes the tests by replacing the touch event for triggering
the toggle with an explicit toggle() call on the SwitchCompat object.
This no longer simulates the user input, but the tests should now
reliably pass.

This CL also corrects the arguments used for
MediaTest#testCombinedPersistenceOffDialog to match those of
MediaTest#testMicrophonePersistenceOffDialog.

BUG= 662294 , 663677 , 668700 

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

[modify] https://crrev.com/c6f2275d2d7d1db5d194f46b4d08e37ebb2769b5/chrome/android/javatests/src/org/chromium/chrome/browser/permissions/GeolocationTest.java
[modify] https://crrev.com/c6f2275d2d7d1db5d194f46b4d08e37ebb2769b5/chrome/android/javatests/src/org/chromium/chrome/browser/permissions/MediaTest.java
[modify] https://crrev.com/c6f2275d2d7d1db5d194f46b4d08e37ebb2769b5/chrome/android/javatests/src/org/chromium/chrome/browser/permissions/PermissionTestCaseBase.java

Components: Tests>Disabled
Labels: Test-Disabled

Sign in to add a comment