WeKnora/internal/application/repository/retriever/weaviate
linus-liu-web 1912ba26c5 test(weaviate): 让并发建表的用例真的每个 worker 都去创建,消掉随机失败
TestEnsureCollectionToleratesConcurrentCreation 用 barrier 让 8 个 worker 都先探到
"class 不存在",再一起冲创建,最后断言 server.creates == workers。但假服务器的 GET
分支是「先等 barrier、再采样 s.exists」:barrier 一放开,赢家的 POST 可能已经把
exists 置为 true,排在后面的 worker 采样到"已存在",就在创建之前返回了,从来没去
尝试创建。实际创建数取决于调度(本地 100 次里挂 1 次;CI 上是 4 或 6),断言于是
随机失败 —— main 自己的 CI 与多个 PR 都挂在这条上。

把采样挪到 barrier 之前:每个 worker 读到的是它到达时的状态(此刻必然为 false),
8 个创建请求全部到达服务端,断言稳定。测试注释里写的意图本来就是"让每个 worker 都
看到 class 缺失",这里只是让实现与意图一致。

只改测试,不碰生产代码。
2026-09-29 01:32:23 +08:00
..
move.go refactor(resource-access): unify scoped authorization and transfer recovery (#3097) 2026-09-08 15:36:33 +08:00
move_test.go refactor(resource-access): unify scoped authorization and transfer recovery (#3097) 2026-09-08 15:36:33 +08:00
repository.go fix(weaviate): accept a class another worker created first (#3689) 2026-09-25 18:47:30 +08:00
repository_test.go test(weaviate): 让并发建表的用例真的每个 worker 都去创建,消掉随机失败 2026-09-29 01:32:23 +08:00
score_test.go fix(retrieval): fix recall correctness, score scales, cost and agent tools (#3687) 2026-09-25 10:48:18 +08:00
structs.go feat: pass IndexConfig to repositories with scalability options 2026-04-17 16:52:24 +08:00