Skip to content

test(e2e): stop the wine teardown from failing a passing test - #404

Merged
speak-agent merged 1 commit into
mainfrom
fix/wine-teardown-race
Aug 10, 2026
Merged

test(e2e): stop the wine teardown from failing a passing test#404
speak-agent merged 1 commit into
mainfrom
fix/wine-teardown-race

Conversation

@speak-agent

Copy link
Copy Markdown
Member

cross-build-test 在 main 的 0006ce6 上是红的(run 31336526583),日志结尾是:

OK
rm: cannot remove '/tmp/tmp.XgyezkVtrY/wineprefix': Directory not empty

测试是过的。 wine 在它启动的进程退出之后仍然留着一个 wineserver,而那个 server 会继续往 $WINEPREFIX 里写,于是 EXIT trap 里的 rm -rf 和它抢。在 set -e 下,trap 的非零状态变成脚本的退出码 —— 一个绿的测试因此报成红的 job,而它报的还是一个临时目录的事,不是 mcpp 的事。

改法:删之前先关掉 wineserver 并等它退出;同时让清理保留测试已经挣到的状态。清理跑在结论打印之后,它没有资格改结论。

全仓只有这一个测试用 WINEPREFIX

`cross-build-test` went red on main at 0006ce6 (run 31336526583) with a log
that ends:

    OK
    rm: cannot remove '/tmp/tmp.XgyezkVtrY/wineprefix': Directory not empty

The test passed. `wine` leaves a wineserver running after the process it
launched exits, and that server keeps writing into $WINEPREFIX, so the
EXIT trap's `rm -rf` races it. Under `set -e` the failing trap becomes the
script's exit status, so a green test reports as a red job — and the
verdict it reports is about a temp directory, not about mcpp.

Shut the server down and wait for it before deleting, and let cleanup
keep the status the test already earned. Cleanup runs after the verdict is
printed; it has no business changing it.
@speak-agent
speak-agent merged commit 3724102 into main Aug 10, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant