• 【CTS】测试工具跑测的过程中没有抓取包含预期打印的log


    1.问题描述

    CtsDevicePolicyManagerTestCases--com.android.cts.devicepolicy.QuietModeHostsideTest#testBroadcastManagedProfileAvailable_withoutCrossProfileAppsOp FAIL

    2.测试命令

    run cts -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.QuietModeHostsideTest#testBroadcastManagedProfileAvailable_withoutCrossProfileAppsOp

    3.同类问题分析过程:

    1.host_log_xxx.txt中搜索关键“ModuleListener”或“fail:”,定向log的报错位置;

    1. 12-22 17:41:54 I/ConsoleReporter: [1/1 armeabi-v7a CtsDevicePolicyManagerTestCases 8T99621AA19A0200170] com.android.cts.devicepolicy.QuietModeHostsideTest#testBroadcastManagedProfileAvailable_withoutCrossProfileAppsOp fail: expected to contain:
    2.     CrossProfileEnabledAppReceiver: onReceive(android.intent.action.MANAGED_PROFILE_AVAILABLE)
    3. but was:
    4.     --------- beginning of system
    5.     12-22 17:38:53.416  1054  2956 W ActivityManager: [HMDenterprise broadcastIntentLocked] intent=Intent { act=com.google.android.gms.gcm.ACTION_SCHEDULE pkg=com.google.android.gms (has extras) }
    6.     12-22 17:38:53.442  1054  3465 D PowerManagerService: updateWakeLockSummaryLocked: mWakefulness=Awake, mWakeLockSummary=0x1
    7. ......
    8.     12-22 17:39:20.335  6706  7584 I DynamiteModule: Considering local module com.google.android.gms.providerinstaller.dynamite:1 and remote module com.google.android.gms.providerinstaller.dynamite:0
    9.     12-22 17:39:20.335  6706  7584 I DynamiteModule: Selected local version of com.google.android.gms.providerinstaller.dynamite
    10.     
    11.     at com.android.cts.devicepolicy.QuietModeHostsideTest.verifyBroadcastSent(QuietModeHostsideTest.java:186)
    12.     at com.android.cts.devicepolicy.QuietModeHostsideTest.checkBroadcastManagedProfileAvailable(QuietModeHostsideTest.java:169)
    13.     at com.android.cts.devicepolicy.QuietModeHostsideTest.testBroadcastManagedProfileAvailable_withoutCrossProfileAppsOp(QuietModeHostsideTest.java:131)
    14.     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    15.     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    16.     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

     确认问题初步原因;此时日志中来看是由于跑测工具抓取的日志未包含预期日志,这里的预期日志为“CrossProfileEnabledAppReceiver: onReceive(android.intent.action.MANAGED_PROFILE_AVAILABLE)”,那么double check下是否该段日志真的未正常打印,那么进一步分析logcat;

     2.device_logcat_test_xxx.txt中搜索“CrossProfileEnabledAppReceiver: onReceive(android.intent.action.MANAGED_PROFILE_AVAILABLE)”,发现包含相关日志,如下:

    1.     Line 50822: 12-22 17:38:00.648  1054  2954 I DevicePolicyManager: Sending android.intent.action.MANAGED_PROFILE_AVAILABLE broadcast to manifest receivers.
    2.     Line 50869: 12-22 17:38:00.659  1054  2954 I DevicePolicyManager: Sending android.intent.action.MANAGED_PROFILE_AVAILABLE broadcast to com.google.android.apps.wellbeing.
    3.     Line 50870: 12-22 17:38:00.659  1054  2954 W ActivityManager: [HMDenterprise broadcastIntentLocked] intent=Intent { act=android.intent.action.MANAGED_PROFILE_AVAILABLE flg=0x1000000 cmp=com.google.android.apps.wellbeing/.workscheduler.manager.ManagedProfileChangesListener_Receiver (has extras) }
    4.     Line 50872: 12-22 17:38:00.661  1054  2954 I DevicePolicyManager: Sending android.intent.action.MANAGED_PROFILE_AVAILABLE broadcast to com.android.cts.crossprofileenabledapp.
    5.     Line 50874: 12-22 17:38:00.661  1054  2954 W ActivityManager: [HMDenterprise broadcastIntentLocked] intent=Intent { act=android.intent.action.MANAGED_PROFILE_AVAILABLE flg=0x1000000 cmp=com.android.cts.crossprofileenabledapp/.CrossProfileEnabledAppReceiver (has extras) }
    6.     Line 50879: 12-22 17:38:00.663  1054  2954 I DevicePolicyManager: Sending android.intent.action.MANAGED_PROFILE_AVAILABLE broadcast to com.android.cts.crossprofileuserenabledapp.
    7.     Line 50880: 12-22 17:38:00.663  1054  2954 W ActivityManager: [HMDenterprise broadcastIntentLocked] intent=Intent { act=android.intent.action.MANAGED_PROFILE_AVAILABLE flg=0x1000000 cmp=com.android.cts.crossprofileuserenabledapp/.CrossProfileUserEnabledAppReceiver (has extras) }
    8.     Line 50881: 12-22 17:38:00.665  1054  2954 I DevicePolicyManager: Sending android.intent.action.MANAGED_PROFILE_AVAILABLE broadcast to com.android.cts.modifyquietmodeenabledapp.
    9.     Line 50882: 12-22 17:38:00.665  1054  2954 W ActivityManager: [HMDenterprise broadcastIntentLocked] intent=Intent { act=android.intent.action.MANAGED_PROFILE_AVAILABLE flg=0x1000000 cmp=com.android.cts.modifyquietmodeenabledapp/.ModifyQuietModeEnabledAppReceiver (has extras) }
    10.     Line 50883: 12-22 17:38:00.665  1054  2954 W ActivityManager: [HMDenterprise broadcastIntentLocked] intent=Intent { act=android.intent.action.MANAGED_PROFILE_AVAILABLE flg=0x40000000 (has extras) }
    11.     Line 51917: 12-22 17:38:04.750  6264  6264 W CrossProfileEnabledAppReceiver: onReceive(android.intent.action.MANAGED_PROFILE_AVAILABLE)
    12.     Line 51920: 12-22 17:38:04.757  6285  6285 W CrossProfileUserEnabledAppReceiver: onReceive(android.intent.action.MANAGED_PROFILE_AVAILABLE)
    13.     Line 51926: 12-22 17:38:04.772  6306  6306 W ModifyQuietModeEnabledAppReceiver: onReceive(android.intent.action.MANAGED_PROFILE_AVAILABLE)
    那么分析下来,mainlog中有该信息,但是在工具跑测抓取的日志片段中未包含;而且跑测工具抓取到的日志比较滞后,确认为工具抓取的日志时长比较短,或者滞后,或者buffer比较小,在跑测抓取的日志比较少的情况下未能包含仅跑测工具的日志片段中,那么此时手动enlarge buffer大小,跑测pass。
    总结:cts工具跑测过程中搜集的日志不能满足跑测要求,在google不能更新工具的情况下,可以手动调整buffer以规避。
  • 相关阅读:
    037纯CSS实现网格背景及点阵背景,及空白点击复位功能
    敏捷=996/007?现实是……
    如何通过优化 Python 中的 GPU 使用率将视频处理速度提高 5 倍(教程含源码)
    C# I/O流: FileStream
    error: failed to push some refs to ‘gitee.com:wavelet-aa/msb_-erp.git
    HTTPS相关概念
    OpenHarmony 社区运营报告(2023 年 10 月)
    Python绘图系统21:导出数据
    测试接口遇到APP加密?先来了解一下算法思路~
    中国金刚石工具市场发展现状及供需格局分析预测报告
  • 原文地址:https://blog.csdn.net/huangyabin001/article/details/126902725