Repository navigation
测试:拿住 copy helper 的句柄再读退出码(修 CI 上常挂的诊断测试) - #88
Merged
Merged
Conversation
TestDiagnosticCrashHelperSurvivesShortLauncher 的 helper 是从进程表里找到的,测试自己不开它的句柄;没有别的进程开着句柄时,它退出以后退出码就读不到(copy helper exit = 0/false),CI 上经常挂,本机 10 次挂 5 次。找到 helper 以后先开一个句柄,测完再关。 Refs ModAVD/ModAVD#97
This was referenced Nov 6, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
internal/emu的TestDiagnosticCrashHelperSurvivesShortLauncher在 CI 的 Windows checks 上经常挂,报copy helper exit = 0/false。#87 的 CI 连跑三次,三次都挂在它上面。本机原样跑 10 次挂 5 次。这是测试本身的问题,产品代码没有错。原因:
win.Process.ExitCode的注释写明,进程退出以后,只有还有句柄开着,退出码才留得住。这个测试里的 copy helper 是从进程表里找出来的,测试自己没有开它的句柄。helper.Wait返回时,它临时开的那个句柄也关了。没有别的进程替它开着句柄时(比如干净的 CI 机器),读退出码就拿到0/false。本机有时能过,是因为碰巧有别的进程开着这个句柄。改法:找到 helper、确认它活着以后,测试自己用
OpenProcess(SYNCHRONIZE | PROCESS_QUERY_INFORMATION)开一个句柄,测完再关。这样退出码一定读得到,后面的断言一条没改。测试
go test ./internal/emu/全过;windows、darwin/arm64、linux/amd64 的go vet ./internal/emu/都过;gofmt -l没有输出;scripts/privacy.py0 失败。另外
TestCollectBootDiagTotal(按 200 ms 计时的那条)在 CI 上也偶尔挂一次,原因不同,这个 PR 没碰它。Refs ModAVD/ModAVD#97