自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
重试隔离
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
如需了解重试功能的工作原理,请参阅“自动重新运行测试”文档。
执行重试时,如果设备已进入不良状态,导致测试无法再成功,请使用隔离功能将设备恢复为全新的初始状态,让测试能够运行并成功。
启用该功能
可以使用 retry 选项加上以下选项来启用重试隔离功能:
--retry-isolation-grade <FULLY_ISOLATED|REBOOT_ISOLATED>
或者使用以下选项停用此功能:
--retry-isolation-grade NOT_ISOLATED
此功能默认处于停用状态。
不同的隔离度
隔离度表示我们希望在两次重试之间配置的隔离程度:
- FULLY_ISOLATED 将重新运行在配置中设置的 target_preparers,从而完全擦除并重新设置设备
- REBOOT_ISOLATED 将重新启动设备
关于兼容性测试套件 (CTS) 的说明
目前,Android 合作伙伴在运行 CTS 时,不支持 FULLY_ISOLATED
结果如何?
结果报告程序将收到一个标记(表示给定的模块或测试运行是在隔离后运行的),并可选择在其报告中显示该标记。
- 在模块级别,
module-isolated
属性将设置为其隔离等级。
- 在运行级别,
run-isolated
属性将设置为其隔离等级。
例如:隔离后运行的第一个模块将报告为 module-isolated:FULLY_ISOLATED
。
在隔离后运行的测试能够发出强烈的信号。无论测试通过还是失败,测试负责人都应该能够确信,设备上并未残留上一次测试中的不良状态。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-03-26。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-03-26。"],[],[],null,["# Retry isolation\n\nSee the [Automatic Test Retry documentation](/docs/core/tests/tradefed/testing/through-tf/auto-retry)\nto understand how the retry feature works.\n\nWhen executing retries, if the device has entered into a bad state\nthat does not allow tests to succeed anymore. Use the isolation\nfeature restore the device into a fresh initial\nstate and allow tests to run and succeed.\n\nEnable the feature\n------------------\n\nThe retry isolation can be enabled with the follow options in addition to the\nretry options: \n\n --retry-isolation-grade \u003cFULLY_ISOLATED|REBOOT_ISOLATED\u003e\n\nor disabled with: \n\n --retry-isolation-grade NOT_ISOLATED\n\nThe feature is disabled by default.\n\n### Different grade of isolation\n\nThe isolation grade represents the extent of the isolation we want to configure\nbetween retries:\n\n- FULLY_ISOLATED will completely wipe \\& resetup the device by rerunning the configured target_preparers of the configuration\n- REBOOT_ISOLATED will reboot the device\n\n### Note on Compatibility Test Suite (CTS)\n\nAndroid partner runs of CTS currently do not support FULLY_ISOLATED\n\nWhat do the results look like?\n------------------------------\n\nResult reporters receive a marker that a given module or run was running in\nisolation and can elect to display the marker in their report.\n\n- At the module level the `module-isolated` property will be set to its isolation grade.\n- At the run level the `run-isolated` property will be set to its isolation grade.\n\nFor example: the first module running after being isolated will be reported as\n`module-isolated:FULLY_ISOLATED`.\n\nA test run in isolation provides a strong signal. Be it pass or fail, the\ntest owner should have high confidence that no bad state from a previous\ntest was left on the device."]]