Design principle and best practice of failpoint
IB401 12:05 ~ 12:30 英語PingCAP failpoint is a golang library that provides a convenient way for developer to inject error code, which is a similar implementation to FreeBSD failpoints and etcd go-fail library. While comparing to go-fail, PingCAP failpoint provides code level support for writing injection code, which makes it more easy to define fail injection and programming friendly to developer. PingCAP failpoint has more practical features including: 1. line number invariability in generated code 2. high readability of generated code 3. parallel tests support with context.Context 4. ability of using outer scope variable in injected code without any cost 5. any syntax's support in injection code including closure, anonymous function. With the help of PingCAP failpoint, golang developer can easily inject error or exception into code by writing injection code, which is similar to writing common logic code, and control the activation of injection by environment variable or some test condition, which makes it easy to simulate error or exception in any large scale complex golang system. related projects: PingCAP failpoint: https://github.com/pingcap/failpoint TiDB: https://github.com/pingcap/tidb TiDB-DM: https://github.com/pingcap/dm