fix(ws): 身份竞态守卫测试改确定性重叠,消除负载型 CI flake - #2200
Merged
Merged
Conversation
- TestConn_AuthSnapshotIsRaceFreeAndCoherent 原依赖写者在读者固定 迭代窗口内抢到 CPU;高负载 runner(Windows CI / 共享 4C 机)下写者 可整窗饥饿 → 误报 'reader never observed a bound identity'。 - 修法:goroutine 启动前预绑一次身份(happens-before,无新竞态面), 且 SetAuth 永不写空值 → 每次 Auth() 读必见已绑定三元组,重叠成为 构造保证而非调度运气。-race 覆盖不变(并发 churn + 读仍在跑)。 - 证据:-race x10、GOMAXPROCS=1 x5(饥饿最劣况)、ws 全量、make test 全绿。 Co-authored-by: Cursor <cursor@vectorcontrol.tech>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
问题
TestConn_AuthSnapshotIsRaceFreeAndCoherent(#2194 引入的竞态守卫测试)在 Windows CI 失败:根因不是产品竞态:测试的读者跑固定 20000 次
Auth(),写者 churn 直到 stop。它假设写者会在读者窗口内至少绑定一次身份——纯调度假设。高负载 runner(Windows CI、本机 4C 满载make test)下写者可整窗饥饿,20000 次读全见空身份 →seen==0误报失败。本机已复现(满负载挂、单跑 3/3 绿)。修复(测试 only,零产品改动)
Auth()读必见已绑定三元组。seen==0改作纯 harness 守卫。-race覆盖不变:并发 churn + 读原样保留。证据
go test -race -count=10:绿GOMAXPROCS=1 -count=5(饥饿最劣况):绿make test全绿(MAKE_TEST_EXIT=0)本 PR 是 #2198 / #2199 CI 变绿的前置(该 flake 当前阻塞所有含 hub 单测的 lane)。