Skip to content
Commit 46f01c16 authored by felkachang's avatar felkachang
Browse files

Fix flaky of DocumentLoaderTest by mock context

DocumentLoaderTest is impacted by the whole system stability. To
make the original test to be DocumentLoaderPerftest as LargeTest.
The default atest DocumentsUITests run DocumentLoaderPerftest.

To fix the flaky test by using mock Context, limit the context only
return the mocked ContentResolver that return InspectorProvider's
instance.

Fixes: 120431745
Bug: 121002105
Test: atest \
  DocumentsUITests:com.android.documentsui.inspector.DocumentLoaderTest
Test: adb shell am instrument -w -e class \
  com.android.documentsui.inspector.DocumentLoaderPerfTest,\
  com.android.documentsui.inspector.DocumentLoaderTest \
  com.android.documentsui.tests/androidx.test.runner.AndroidJUnitRunner

Test: adb shell am instrument -w \
  -e notAnnotation androidx.test.filters.LargeTest \
  -e class com.android.documentsui.inspector.DocumentLoaderPerfTest,\
  com.android.documentsui.inspector.DocumentLoaderTest \
  com.android.documentsui.tests/androidx.test.runner.AndroidJUnitRunner

Change-Id: I5cb0c1f98d96d81b22a26b00c7df67bc15334cf5
parent a9cfc1c5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment