@@ -11,7 +11,7 @@ use fail::fail_point;
1111#[ cfg_attr( not( feature = "failpoints" ) , ignore) ]
1212fn test_pause ( ) {
1313 let local_registry = fail:: new_fail_group ( ) ;
14- local_registry. register_current ( ) ;
14+ local_registry. register_current ( ) . unwrap ( ) ;
1515 let f = || {
1616 fail_point ! ( "pause" ) ;
1717 } ;
@@ -21,7 +21,7 @@ fn test_pause() {
2121 let ( tx, rx) = mpsc:: channel ( ) ;
2222 let thread_registry = local_registry. clone ( ) ;
2323 thread:: spawn ( move || {
24- thread_registry. register_current ( ) ;
24+ thread_registry. register_current ( ) . unwrap ( ) ;
2525 // pause
2626 tx. send ( f ( ) ) . unwrap ( ) ;
2727 // woken up by new order pause, and then pause again.
@@ -44,7 +44,7 @@ fn test_pause() {
4444#[ test]
4545fn test_off ( ) {
4646 let local_registry = fail:: new_fail_group ( ) ;
47- local_registry. register_current ( ) ;
47+ local_registry. register_current ( ) . unwrap ( ) ;
4848
4949 let f = || {
5050 fail_point ! ( "off" , |_| 2 ) ;
@@ -60,7 +60,7 @@ fn test_off() {
6060#[ cfg_attr( not( feature = "failpoints" ) , ignore) ]
6161fn test_return ( ) {
6262 let local_registry = fail:: new_fail_group ( ) ;
63- local_registry. register_current ( ) ;
63+ local_registry. register_current ( ) . unwrap ( ) ;
6464
6565 let f = || {
6666 fail_point ! ( "return" , |s: Option <String >| s
@@ -80,7 +80,7 @@ fn test_return() {
8080#[ cfg_attr( not( feature = "failpoints" ) , ignore) ]
8181fn test_sleep ( ) {
8282 let local_registry = fail:: new_fail_group ( ) ;
83- local_registry. register_current ( ) ;
83+ local_registry. register_current ( ) . unwrap ( ) ;
8484
8585 let f = || {
8686 fail_point ! ( "sleep" ) ;
@@ -100,7 +100,7 @@ fn test_sleep() {
100100#[ cfg_attr( not( feature = "failpoints" ) , ignore) ]
101101fn test_panic ( ) {
102102 let local_registry = fail:: new_fail_group ( ) ;
103- local_registry. register_current ( ) ;
103+ local_registry. register_current ( ) . unwrap ( ) ;
104104
105105 let f = || {
106106 fail_point ! ( "panic" ) ;
@@ -113,7 +113,7 @@ fn test_panic() {
113113#[ cfg_attr( not( feature = "failpoints" ) , ignore) ]
114114fn test_print ( ) {
115115 let local_registry = fail:: new_fail_group ( ) ;
116- local_registry. register_current ( ) ;
116+ local_registry. register_current ( ) . unwrap ( ) ;
117117
118118 struct LogCollector ( Arc < Mutex < Vec < String > > > ) ;
119119 impl log:: Log for LogCollector {
@@ -149,7 +149,7 @@ fn test_print() {
149149#[ test]
150150fn test_yield ( ) {
151151 let local_registry = fail:: new_fail_group ( ) ;
152- local_registry. register_current ( ) ;
152+ local_registry. register_current ( ) . unwrap ( ) ;
153153
154154 let f = || {
155155 fail_point ! ( "yield" ) ;
@@ -162,7 +162,7 @@ fn test_yield() {
162162#[ cfg_attr( not( feature = "failpoints" ) , ignore) ]
163163fn test_callback ( ) {
164164 let local_registry = fail:: new_fail_group ( ) ;
165- local_registry. register_current ( ) ;
165+ local_registry. register_current ( ) . unwrap ( ) ;
166166
167167 let f1 = || {
168168 fail_point ! ( "cb" ) ;
@@ -186,7 +186,7 @@ fn test_callback() {
186186#[ cfg_attr( not( feature = "failpoints" ) , ignore) ]
187187fn test_delay ( ) {
188188 let local_registry = fail:: new_fail_group ( ) ;
189- local_registry. register_current ( ) ;
189+ local_registry. register_current ( ) . unwrap ( ) ;
190190
191191 let f = || fail_point ! ( "delay" ) ;
192192 let timer = Instant :: now ( ) ;
@@ -199,7 +199,7 @@ fn test_delay() {
199199#[ cfg_attr( not( feature = "failpoints" ) , ignore) ]
200200fn test_freq_and_count ( ) {
201201 let local_registry = fail:: new_fail_group ( ) ;
202- local_registry. register_current ( ) ;
202+ local_registry. register_current ( ) . unwrap ( ) ;
203203
204204 let f = || {
205205 fail_point ! ( "freq_and_count" , |s: Option <String >| s
@@ -223,7 +223,7 @@ fn test_freq_and_count() {
223223#[ cfg_attr( not( feature = "failpoints" ) , ignore) ]
224224fn test_condition ( ) {
225225 let local_registry = fail:: new_fail_group ( ) ;
226- local_registry. register_current ( ) ;
226+ local_registry. register_current ( ) . unwrap ( ) ;
227227
228228 let f = |_enabled| {
229229 fail_point ! ( "condition" , _enabled, |_| 2 ) ;
@@ -240,7 +240,7 @@ fn test_condition() {
240240#[ test]
241241fn test_list ( ) {
242242 let local_registry = fail:: new_fail_group ( ) ;
243- local_registry. register_current ( ) ;
243+ local_registry. register_current ( ) . unwrap ( ) ;
244244
245245 assert ! ( !fail:: list( ) . contains( & ( "list" . to_string( ) , "off" . to_string( ) ) ) ) ;
246246 fail:: cfg ( "list" , "off" ) . unwrap ( ) ;
@@ -252,11 +252,11 @@ fn test_list() {
252252#[ test]
253253fn test_multiple_threads_cleanup ( ) {
254254 let local_registry = fail:: new_fail_group ( ) ;
255- local_registry. register_current ( ) ;
255+ local_registry. register_current ( ) . unwrap ( ) ;
256256
257257 let ( tx, rx) = mpsc:: channel ( ) ;
258258 thread:: spawn ( move || {
259- local_registry. register_current ( ) ;
259+ local_registry. register_current ( ) . unwrap ( ) ;
260260 fail:: cfg ( "thread_point" , "sleep(10)" ) . unwrap ( ) ;
261261 tx. send ( ( ) ) . unwrap ( ) ;
262262 } ) ;
@@ -272,7 +272,7 @@ fn test_multiple_threads_cleanup() {
272272 let ( tx, rx) = mpsc:: channel ( ) ;
273273 let t = thread:: spawn ( move || {
274274 let local_registry = fail:: new_fail_group ( ) ;
275- local_registry. register_current ( ) ;
275+ local_registry. register_current ( ) . unwrap ( ) ;
276276 fail:: cfg ( "thread_point" , "panic" ) . unwrap ( ) ;
277277 let l = fail:: list ( ) ;
278278 assert ! (
0 commit comments