Repository navigation
修正状态页线程测试的竞态(合并后 main 上唯一红掉的作业) - #20
Merged
Merged
Conversation
`test_the_status_page_is_built_off_the_command_thread` asserted "one reply so far" immediately after `!!muc status` returned, while the worker thread was free to finish and post the whole screen in the meantime. It passed on the pull request and locally, and failed on the merged main — a race in the test, not in the plugin. The worker is now held on an event until the acknowledgement has been checked, so the assertion cannot race it. The test was run repeatedly to confirm.
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.
改了什么
test_the_status_page_is_built_off_the_command_thread在!!muc status返回后立刻断言「此刻只有一条回复」,而 worker 线程完全可能在这两行之间就把整屏发出去。它在上一个 PR 的分支上是绿的、合并后的 main 上红了——是测试自己的竞态,不是插件的竞态。现在 worker 由一个事件闸门挡住,直到测试检查完那条回执才放行,断言不再与它抢时间。本机连续跑 6 轮通过。
为什么
合并后的 main(run #42)唯一失败的就是
unit tests (Python 3.10),失败点就是这条断言。留着它会让 main 一直是红的,并且掩盖真正的问题。如何验证
pytest(含 2 项真实 MCDR 端到端)→ 827 passedruff check .→ 0 项