android.content.cts.ContentProviderCursorWindowTest#testQuery 处理方法

[DESCRIPTION]
 在CTS 测试中,android.content.cts.ContentProviderCursorWindowTest#testQuery
出现两种错误信息

1)fail: Test failed to run to completion. Reason: 'Instrumentation run failed due to 'Process crashed.''. Check device logcat for details
07-02 21:51:03.224 7260 9452 E AndroidRuntime: FATAL EXCEPTION: Terminator
07-02 21:51:03.224 7260 9452 E AndroidRuntime: Process: android.content.cts, PID: 7260
07-02 21:51:03.224 7260 9452 E AndroidRuntime: java.lang.IllegalStateException: Test timed out after 300000 milliseconds but execution thread failed to terminate
07-02 21:51:03.224 7260 9452 E AndroidRuntime: Dumping instr and main threads:
07-02 21:51:03.224 7260 9452 E AndroidRuntime: Thread[Instr: android.support.test.runner.AndroidJUnitRunner,5,main]
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at dalvik.system.VMStack.getThreadStackTrace(Native Method)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at java.lang.Thread.getStackTrace(Thread.java:1566)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at android.support.test.internal.runner.junit3.AndroidTestSuite.getStackTraces(AndroidTestSuite.java:174)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at android.support.test.internal.runner.junit3.AndroidTestSuite.runTestWithTimeout(AndroidTestSuite.java:128)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at android.support.test.internal.runner.junit3.AndroidTestSuite.runTestsWithTimeout(AndroidTestSuite.java:80)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at android.support.test.internal.runner.junit3.AndroidTestSuite.run(AndroidTestSuite.java:66)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at android.support.test.internal.runner.junit3.JUnit38ClassRunner.run(JUnit38ClassRunner.java:103)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at org.junit.runners.Suite.runChild(Suite.java:128)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at org.junit.runners.Suite.runChild(Suite.java:27)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at android.support.test.internal.runner.TestExecutor.execute(TestExecutor.java:59)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:272)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1996)
07-02 21:51:03.224 7260 9452 E AndroidRuntime:
07-02 21:51:03.224 7260 9452 E AndroidRuntime: Thread[main,5,main]
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at android.os.MessageQueue.nativePollOnce(Native Method)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at android.os.MessageQueue.next(MessageQueue.java:328)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6528)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1084)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:945)
07-02 21:51:03.224 7260 9452 E AndroidRuntime:
07-02 21:51:03.224 7260 9452 E AndroidRuntime:
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at android.support.test.internal.runner.junit3.AndroidTestSuite.runTestWithTimeout(AndroidTestSuite.java:128)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at android.support.test.internal.runner.junit3.AndroidTestSuite.runTestsWithTimeout(AndroidTestSuite.java:80)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at android.support.test.internal.runner.junit3.AndroidTestSuite.run(AndroidTestSuite.java:66)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at android.support.test.internal.runner.junit3.JUnit38ClassRunner.run(JUnit38ClassRunner.java:103)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at org.junit.runners.Suite.runChild(Suite.java:128)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at org.junit.runners.Suite.runChild(Suite.java:27)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at android.support.test.internal.runner.TestExecutor.execute(TestExecutor.java:59)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:272)
07-02 21:51:03.224 7260 9452 E AndroidRuntime: at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1996)
2)06-27 10:13:41.770  3743  3756 E Parcel  : Attempt to read from protected data in Parcel 0xaa6c8d70

06-27 10:13:41.770  3743  3756 E Parcel  : Attempt to read from protected data in Parcel 0xaa6c8d70

06-27 10:13:41.770  3743  3756 E Parcel  : Attempt to read from protected data in Parcel 0xaa6c8d70

06-27 10:13:41.770  3743  3756 E Parcel  : Attempt to read from protected data in Parcel 0xaa6c8d70

06-27 10:13:41.771  3724  3740 W Parcel  : Attempt to read object from Parcel 0xa5e1e1c0 at offset 68 that is not in the object list

06-27 10:13:41.771  3724  3740 E CursorWindow: CursorWindow::createFromParcel, BAD_TYPE:-2147483647

06-27 10:13:41.771  3724  3740 E CursorWindow: Could not create CursorWindow from Parcel due to error -2147483647.

06-27 10:13:41.773  3724  3740 I TestRunner: failed: testQuery(android.content.cts.ContentProviderCursorWindowTest)

06-27 10:13:41.773  3724  3740 I TestRunner: ----- begin exception -----

06-27 10:13:41.775  3724  3740 I TestRunner: android.database.CursorWindowAllocationException: Cursor window could not be created from binder.

06-27 10:13:41.775  3724  3740 I TestRunner:          at android.database.CursorWindow.<init>(CursorWindow.java:137)

06-27 10:13:41.775  3724  3740 I TestRunner:          at android.database.CursorWindow.<init>(CursorWindow.java)

06-27 10:13:41.775  3724  3740 I TestRunner:          at android.database.CursorWindow$1.createFromParcel(CursorWindow.java:685)

06-27 10:13:41.775  3724  3740 I TestRunner:          at android.database.CursorWindow$1.createFromParcel(CursorWindow.java:684)

06-27 10:13:41.775  3724  3740 I TestRunner:          at android.database.BulkCursorDescriptor.readFromParcel(BulkCursorDescriptor.java:75)

06-27 10:13:41.775  3724  3740 I TestRunner:          at android.database.BulkCursorDescriptor$1.createFromParcel(BulkCursorDescriptor.java:34)

06-27 10:13:41.775  3724  3740 I TestRunner:          at android.database.BulkCursorDescriptor$1.createFromParcel(BulkCursorDescriptor.java:32)

06-27 10:13:41.775  3724  3740 I TestRunner:          at android.content.ContentProviderProxy.query(ContentProviderNative.java:424)

06-27 10:13:41.775  3724  3740 I TestRunner:          at android.content.ContentResolver.query(ContentResolver.java:537)

[SOLUTION]
 问题原因是 ALPS03965552 这笔问题,其中有两笔patch ,分别是在 6月14 / 7月6日 释放的patch
而敝司在 6月14 ~ 7月6日 间发送结合patch ALPS03983312
因此,ALPS03983312  patch  只包含了一笔patch,因此引发patch 不足引起错误 (具体差那笔要自己比对)
错误内容为1)
fail: Test failed to run to completion. Reason: 'Instrumentation run failed due to 'Process crashed.''. Check device logcat for details
-----
两笔patch 内部链接:
  1.          [ALPS03965552] Disallow reading object data from Parcels with non-object reads

-          http://gerrit.mediatek.inc:8080/c/platform/frameworks/native/+/1582307

  1.  [ALPS03965552] Increment when attempting to read protected Parcel Data

-          http://gerrit.mediatek.inc:8080/c/platform/frameworks/native/+/1630638

两笔patch diff 如下:
 [ALPS03965552] Increment when attempting to read protected Parcel Data
[ALPS03965552] Disallow reading object data from Parcels with non-object reads
当两笔patch 都合入,将出现如下Log

06-27 10:13:41.773  3724  3740 I TestRunner: ----- begin exception -----

06-27 10:13:41.775  3724  3740 I TestRunner: android.database.CursorWindowAllocationException: Cursor window could not be created from binder.

06-27 10:13:41.775  3724  3740 I TestRunner:          at android.database.CursorWindow.<init>(CursorWindow.java:137)

06-27 10:13:41.775  3724  3740 I TestRunner:          at android.database.CursorWindow.<init>(CursorWindow.java)

06-27 10:13:41.775  3724  3740 I TestRunner:          at android.database.CursorWindow$1.createFromParcel(CursorWindow.java:685)

06-27 10:13:41.775  3724  3740 I TestRunner:          at android.database.CursorWindow$1.createFromParcel(CursorWindow.java:684)

如何是如上错误,当前的问题是google issue , 请申请豁免

 

https://android-review.googlesource.com/c/platform/cts/+/705304

Make CTS test testQuery more flexible

It shouldn't fail on systems without protected Parcel data patch.

Test: atest android.content.cts.ContentProviderCursorWindowTest

Bug: 78176586

Bug: 80207731

作者: RESSRC

个人资源站

发表评论

邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据