pingcap / pingcap/failpoint

Register an action func to be called when a failpoint is evaluated

Open
#64 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
895
Forks
67
PR merge metrics
No merged PRs in 30d

Description

Feature Request

Is your feature request related to a problem? Please describe:
When writing a unit test, I want to know if a failpoint is evaluated and the evaluated value.

Describe the feature you'd like:
When enabling a failpoint, pass in a function callback func(val interface{}). Afterwards, whenever the failpoint is evaluated, failpoint is responsible to call callback.

Describe alternatives you've considered:
Allow user to register a function to replace term. Every time the failpoint is evaluated, it calls the function to get the value.

Teachability, Documentation, Adoption, Optimization:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name files, tests, or entry points. Locate the failpoint enabling and evaluation paths, then determine how the callback API should receive each evaluated value and add coverage showing the callback runs whenever evaluation occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.