components/engine_test: fix double-lock in open_tablet
ref tikv/tikv#13186
@@ -261,8 +261,7 @@ pub mod kv {
}
fn open_tablet(&self, id: u64, suffix: u64) -> Result<KvTestEngine> {
- let reg = self.registry.lock().unwrap();
- if let Some(db) = reg.get(&(id, suffix)) {
+ if let Some(db) = self.registry.lock().unwrap().get(&(id, suffix)) {
return Ok(db.clone());
}
