自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
重試隔離
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
請參閱自動測試重試功能說明文件,瞭解重試功能的運作方式。
執行重試時,如果裝置已進入無法再讓測試成功的錯誤狀態,使用隔離功能將裝置還原為全新的初始狀態,並允許測試執行並成功。
啟用這項功能
除了重試選項外,您還可以使用下列選項啟用重試隔離功能:
--retry-isolation-grade <FULLY_ISOLATED|REBOOT_ISOLATED>
或停用:
--retry-isolation-grade NOT_ISOLATED
這項功能預設為停用。
不同等級的隔離
隔離等級代表我們要在重試之間設定的隔離程度:
- FULLY_ISOLATED 會重新執行設定的 target_preparer,藉此徹底清除並重設裝置
- REBOOT_ISOLATED 會重新啟動裝置
Compatibility Test Suite (CTS) 相關注意事項
Android 合作夥伴執行的 CTS 目前不支援 FULLY_ISOLATED
結果會是什麼樣子?
結果回報器會收到標記,指出特定模組或執行作業是獨立執行,並可選擇在報表中顯示標記。
- 在模組層級,
module-isolated
屬性會設為其隔離等級。
- 在執行層級,
run-isolated
屬性會設為其隔離等級。
舉例來說,在隔離後執行的第一個模組會回報為 module-isolated:FULLY_ISOLATED
。
獨立執行的測試可提供強烈信號。無論測試結果是否通過,測試擁有者都應確信裝置不會保留先前測試的不良狀態。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","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"]],["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],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."]]