VtsKernelProcFileApiTest: Fix testProcUidProcstatSet IndexError
testProcUidProcstatSet test was crashing python with the following exception:
======================================================================
ERROR: testProcUidProcstatSet (__main__.VtsKernelProcFileApiTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/Soong.python_bfmswr_h/vts_kernel_proc_file_api_test.py", line 203,
in testProcUidProcstatSet
CheckStatsInState(False)
File "/tmp/Soong.python_bfmswr_h/vts_kernel_proc_file_api_test.py", line 194,
in CheckStatsInState
old_wchar = UidIOStats(root_uid)[wchar_index]
IndexError: list index out of range
This resolves the crash and allows the test suite to finish, but in the
error case which is causing the above crash, the test case will fail
with the following signature:
__main__.VtsKernelProcFileApiTest.testProcUidProcstatSet#testProcUidProcstatSet
fail: Traceback (most recent call last):
File "/tmp/Soong.python_s5nustga/vts_kernel_proc_file_api_test.py", line 228,
in testProcUidProcstatSet
CheckStatsInState(False)
File "/tmp/Soong.python_s5nustga/vts_kernel_proc_file_api_test.py", line 218,
in CheckStatsInState
old_wchar = GetWcharCount(root_uid, state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/Soong.python_s5nustga/vts_kernel_proc_file_api_test.py", line 202,
in GetWcharCount
self.assertTrue(arr_len == 11,
AssertionError: False is not true : Array len returned by UidIOStats()
unexpected: 0
armeabi-v7a vts_kernel_proc_file_api_test completed in 1m 14s. 66 passed,
1 failed, 0 not executed
The underlying cause of the issue is still under investigation.
Bug: 293215373
Bug: 304711159
Test: manual execution of vts_kernel_proc_file_api_test with and without
error data injected into UidIOStats()
Signed-off-by: Neill Kapron <nkapron@google.com>
(cherry picked from https://android-review.googlesource.com/q/commit:a82c4edb8bd3fe69f5d3caf073046405afc2daea)
Merged-In: I2bd9d5ae9764e2a56b68a898d648facc49114d07
Change-Id: I2bd9d5ae9764e2a56b68a898d648facc49114d07
1 file changed