Closed lonng closed 5 years ago
Merging #19 into master will increase coverage by
0.124%
. The diff coverage is100%
.
@@ Coverage Diff @@
## master #19 +/- ##
===============================================
+ Coverage 78.5133% 78.6374% +0.124%
===============================================
Files 7 7
Lines 861 866 +5
===============================================
+ Hits 676 681 +5
Misses 109 109
Partials 76 76
Signed-off-by: Lonng chris@lonng.org
What problem does this PR solve?
Support nil closure
If we want a failpoint just sleep a duration like
failpoint.Enable("failpoint-name", "sleep(500))
, we must use a function without any statements and that will cause generated code line inconsistent.In following case:
Will generate:
Add
Return
marker functionIf we need an
early return
in failpoint with some conditions like above case. We will get unexpected result because there is alwaysearly return
if failpoint is active. So we need aReturn
marker function.What is changed and how it works?
Add support for nil closure, which will generate a
failpoint.Eval(...)
call instead of an IF statement.Check List
Tests
Side effects
N/A
Related changes
N/A