|  | 
| 76 | 76 | //! environment variable. In practice, you'll often want to trigger fail points | 
| 77 | 77 | //! programmatically, in unit tests. | 
| 78 | 78 | //! | 
| 79 |  | -//! Fail points are managed by the registry which store a map of the fail points | 
|  | 79 | +//! Fail points are managed by the registry which stores a map of the fail points | 
| 80 | 80 | //! names and actions. The registry is divided into local and global. | 
| 81 | 81 | //! | 
| 82 |  | -//! When you don't specifically declare a registry, the global registry will be used | 
|  | 82 | +//! When you don't declare a registry explicitly, the global registry will be used | 
| 83 | 83 | //! by default. You can pass the setting from environment variables to the global registry. | 
| 84 | 84 | //! Sometimes you need different tests to use different registries and don’t want their | 
| 85 | 85 | //! behavior to interfere with each other. You can create a local registry and then register | 
|  | 
| 110 | 110 | //! } | 
| 111 | 111 | //! ``` | 
| 112 | 112 | //! | 
| 113 |  | -//! It should be noted that the local registry will will overwrite the global registry | 
|  | 113 | +//! It should be noted that the local registry will overwrite the global registry | 
| 114 | 114 | //! if you register the current thread here. This means that the current thread can only | 
| 115 | 115 | //! use the fail points configuration of the local registry after registration. | 
| 116 | 116 | //! | 
|  | 
| 133 | 133 | //! } | 
| 134 | 134 | //! println!("Global registry: {:?}", fail::list()); | 
| 135 | 135 | //! ``` | 
| 136 |  | -//! When the example is run normally it prints out the contents of the registry used | 
|  | 136 | +//! The example will print out the contents of the registry used | 
| 137 | 137 | //! at the time. | 
| 138 | 138 | //! | 
| 139 | 139 | //! ```sh | 
| 140 | 140 | //! FAILPOINTS=p0=return cargo run --features fail/failpoints | 
| 141 | 141 | //!     Finished dev [unoptimized + debuginfo] target(s) in 0.01s | 
| 142 | 142 | //!      Running `target/debug/failpointtest` | 
| 143 |  | -//! Global registry: [("p1", "sleep(100)")] | 
|  | 143 | +//! Global registry: [("p0", "return"), ("p1", "sleep(100)")] | 
| 144 | 144 | //! Local registry: [("p0", "pause")] | 
| 145 | 145 | //! Local registry: [] | 
| 146 |  | -//! Global registry: [("p1", "sleep(100)")] | 
|  | 146 | +//! Global registry: [("p0", "return"), ("p1", "sleep(100)")] | 
| 147 | 147 | //! ``` | 
| 148 | 148 | //! | 
| 149 | 149 | //! In this example, program update global registry with environment variable first. | 
|  | 
0 commit comments