CtsStorageHostTestCases :
operate:To prevent excessive interference with data read and write operations, dynamically calculate the difference

The larger the storage space of the device, the larger the cache space allocated to the testing application, and the longer the time required to write to the cache. Therefore, interference from other data write operations in the system leads to greater changes in storage space, resulting in a larger final difference.
This difference should be dynamically adjusted based on the actual cache size used by the testing application.

failure message:
java.lang.AssertionError: on-device tests failed:
com.android.cts.storagestatsapp.StorageStatsTest#testCacheClearing:
junit.framework.AssertionFailedError: Expected roughly 984658219008 but was 984517136384 [UserHandle{0}]
	at com.android.cts.storageapp.Utils.assertMostlyEquals(Utils.java:100)
	at com.android.cts.storagestatsapp.StorageStatsTest.testCacheClearing(StorageStatsTest.java:397)

Bug: 355595400
Test: run cts-on-gsi -m CtsStorageHostTestCases -t android.appsecurity.cts.StorageHostTest#testCache
(cherry picked from https://android-review.googlesource.com/q/commit:3be2b0e09b9cfa5da9b62d8d5c96e9d194da8a91)
Merged-In: I1350ca83765a09e20af17f2f7fa73862caa0cb55
Change-Id: I1350ca83765a09e20af17f2f7fa73862caa0cb55
1 file changed