# celld 如何用确定性模拟测试揪出分布式 Bug

Original title: Deterministic Simulation Testing in Celld

> Hacker News story 50024805 · language: zh · submitted 2026-10-09
> Web version: https://zeli.app/zh/story/50024805
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 35 · by [handfuloflight](<https://news.ycombinator.com/user?id=handfuloflight>) · 💬 5
[original](<https://celld.dev/docs/engineering/deterministic-simulation-testing/>) · [HN discussion](<https://news.ycombinator.com/item?id=50024805>)

## Summary

构建分布式系统时，网络可靠和零延迟等假设往往不攻自破，导致 Bug 难以复现。celld 团队引入确定性模拟测试（DST），在受控环境中运行生产代码，让模拟器掌控事件顺序、异步任务及存储响应。通过固定随机种子，团队成功复现并修复了一个因闹钟（alarm）与清理任务竞态导致的严重缺陷：旧闹钟的清理操作意外删除了新闹钟所需的唤醒条目。这种测试方法不仅精准定位了问题，还将失败场景转化为回归测试，确保系统在面对复杂并发和故障时依然可靠。

## Key quote

> 一个 Bug 可能依赖于特定顺序的延迟消息、写入失败和节点重启，而这些事件在下一次测试运行时可能以不同顺序发生，导致故障难以复现。

## HN discussion (5 comments)

### [tontinton](<https://news.ycombinator.com/item?id=50040337>)

> 在这个时代，如果不使用 DST 就构建新的分布式系统，简直没有任何借口，AI 可没那么懒。

### [mrkn1](<https://news.ycombinator.com/item?id=50041678>)

> \> once celld has confirmed they're no longer needed
>
> 这不就是换个地方出现的“检查后执行”竞态条件吗？这种情况是否被某个不变量覆盖了？

### [winterqt](<https://news.ycombinator.com/item?id=50047632>)

> 例行公事地附上“什么是确定性模拟测试”的链接：https://youtu.be/4fFDFbi3toc

---

## Cite

- Page: https://zeli.app/zh/story/50024805
- Date: 2026-10-09
- Source: celld.dev (https://celld.dev/docs/engineering/deterministic-simulation-testing/)
- Hacker News: https://news.ycombinator.com/item?id=50024805

## Other languages

- en: https://zeli.app/story/50024805 · markdown: https://zeli.app/story/50024805.md
- ja: https://zeli.app/ja/story/50024805 · markdown: https://zeli.app/ja/story/50024805.md
- ko: https://zeli.app/ko/story/50024805 · markdown: https://zeli.app/ko/story/50024805.md
- de: https://zeli.app/de/story/50024805 · markdown: https://zeli.app/de/story/50024805.md
- es: https://zeli.app/es/story/50024805 · markdown: https://zeli.app/es/story/50024805.md
- ru: https://zeli.app/ru/story/50024805 · markdown: https://zeli.app/ru/story/50024805.md
