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

Issue 705477 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Not on Chrome anymore
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug



Sign in to add a comment

TileGroupTest flaky Strict Mode violation failures

Project Member Reported by dgn@chromium.org, Mar 27 2017

Issue description

Sample builds:
https://uberchromegw.corp.google.com/i/chromium.android/builders/Lollipop%20Tablet%20Tester/builds/7301
https://uberchromegw.corp.google.com/i/chromium.android/builders/Lollipop%20Tablet%20Tester/builds/7300

[FAIL] org.chromium.chrome.browser.suggestions.TileGroupTest#testDismissTileUndo:
android.os.StrictMode$StrictModeViolation: policy=2655 violation=2
	at android.os.StrictMode.executeDeathPenalty(StrictMode.java:1379)
	at android.os.StrictMode.access$1300(StrictMode.java:118)
	at android.os.StrictMode$AndroidBlockGuardPolicy.handleViolation(StrictMode.java:1372)
	at android.os.StrictMode$AndroidBlockGuardPolicy$1.run(StrictMode.java:1254)
	at android.os.Handler.handleCallback(Handler.java:739)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:135)
	at android.app.ActivityThread.main(ActivityThread.java:5254)
	at java.lang.reflect.Method.invoke(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:372)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)


Similar to  issue 574532 
 

Comment 1 by dgn@chromium.org, Mar 27 2017

Cc: mvanouwe...@chromium.org
Status: Started (was: Assigned)
Bigger trace from logcat:

StrictMode policy violation; ~duration=37 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=2655 violation=2
	at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1137)
	at libcore.io.BlockGuardOs.open(BlockGuardOs.java:182)
	at libcore.io.IoBridge.open(IoBridge.java:442)
	at libcore.io.IoUtils$FileReader.<init>(IoUtils.java:209)
	at libcore.io.IoUtils.readFileAsString(IoUtils.java:116)
	at java.util.TimeZone.getDefault(TimeZone.java:143)
	at java.util.GregorianCalendar.<init>(GregorianCalendar.java:231)
	at java.util.Calendar.getInstance(Calendar.java:972)
	at org.chromium.chrome.browser.ntp.cards.AllDismissedItem$ViewHolder.onBindViewHolder(AllDismissedItem.java:61)
	at org.chromium.chrome.browser.ntp.cards.AllDismissedItem.onBindViewHolder(AllDismissedItem.java:35)
	at org.chromium.chrome.browser.ntp.cards.OptionalLeaf.onBindViewHolder(OptionalLeaf.java:40)
	at org.chromium.chrome.browser.ntp.cards.InnerNode.onBindViewHolder(InnerNode.java:82)
	at org.chromium.chrome.browser.ntp.cards.NewTabPageAdapter.onBindViewHolder(NewTabPageAdapter.java:164)
	at org.chromium.chrome.browser.ntp.cards.NewTabPageAdapter.onBindViewHolder(NewTabPageAdapter.java:37)
	at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6100)
	at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5282)
	at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5158)
	at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2061)
	at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1445)
	at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1408)
	at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:580)
	at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3379)
	at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3188)
	at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3632)
	at org.chromium.chrome.browser.suggestions.SuggestionsRecyclerView.onLayout(SuggestionsRecyclerView.java:155)
	at android.view.View.layout(View.java:15671)


According to mvanouwerkerk@ on issue 577185#c5, TimeZone#getDefault will read /etc/timezone if the persist.sys.timezone system property is not set.

That was fixed by temporarily allowing disk access for the call(s) causing the flake.

Comment 2 by bauerb@chromium.org, Mar 27 2017

Can we preload the calendar during the setup phase?

Comment 3 by dgn@chromium.org, Mar 27 2017

Cc: jbudorick@chromium.org
Components: Test>Android
Flakiness dashboard link: https://test-results.appspot.com/dashboards/flakiness_dashboard.html#testType=chrome_public_test_apk&tests=TileGroupTest


I have 2 CLs pending: 
- https://codereview.chromium.org/2779593003 - preloads Calendar for all tests to hopefully get rid of these failures everywhere
- https://codereview.chromium.org/2778743002 - allows reads in the production code. Ideally I'd prefer not to have to land that as we have no evidence that it's an issue that happens in the wild

jbudorick@: Is there a way to check the devices we run the tests on to see their properties? Could we enforce that the time zone data is still available after they get reprovisioned?
Project Member

Comment 4 by bugdroid1@chromium.org, Mar 27 2017

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

commit f51dc18c55c7af0bac195c1b507398c5f408f0bf
Author: dgn <dgn@chromium.org>
Date: Mon Mar 27 16:24:13 2017

[Android Tests] Preload Calendar to avoid StrictMode violations

In instrumentation tests Calendar#getInstance can trigger ReadFromDisk
StrictMode violations when it needs to read system files to obtain the
time zone, which make tests fail. This patch preloads Calendar to avoid
it happening later on the UI Thread and avoid these flakes.

BUG= 705477 

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

[modify] https://crrev.com/f51dc18c55c7af0bac195c1b507398c5f408f0bf/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeActivityTestCaseBase.java

Comment 5 by dgn@chromium.org, Mar 28 2017

Status: Fixed (was: Started)
flakiness dashboard[1] is now in its longest green since quite a while now, so I'll consider this fixed.


[1]: https://test-results.appspot.com/dashboards/flakiness_dashboard.html#testType=chrome_public_test_apk&tests=TileGroupTest

Sign in to add a comment