fail-rs icon indicating copy to clipboard operation
fail-rs copied to clipboard

Thread-local failpoints

Open brson opened this issue 6 years ago • 1 comments

Is your feature request related to a problem? Please describe.

Failpoint unit tests require taking a global lock, preventing test parallelism. An alternate or complimentary solution to a global lock (https://github.com/pingcap/fail-rs/issues/23) would be to have a thread-local failpoint configuration, protected by a guard.

Describe the solution you'd like Add a thread-local configuration that is protected by a guard that performs teardown.

Describe alternatives you've considered Global locks: https://github.com/pingcap/fail-rs/issues/23

Additional context This would work for single-threaded test cases, but not generally for tests that require multiple threads.

brson avatar Jan 03 '19 23:01 brson

Or the library can expose the FailPointRegistry to users, so users can control the lock pattern more precisely.

BusyJay avatar Jan 24 '19 07:01 BusyJay