Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

rust/cli: avoid holding test lock across await

Neeraj Gupta57ae6c930b4c
diff --git a/rust/cli/src/auth_flow.rs b/rust/cli/src/auth_flow.rs
index 5d619b88a4..3d5083d7c0 100644
--- a/rust/cli/src/auth_flow.rs
+++ b/rust/cli/src/auth_flow.rs
@@ -651,10 +651,13 @@ mod tests {
Some(signup_token.as_str())
);
- let state = signup_state.lock().unwrap();
- let uploaded_key_attributes = state.uploaded_key_attributes.clone().unwrap();
- let remote_srp_attributes = state.remote_srp_attributes.clone().unwrap();
- drop(state);
+ let (uploaded_key_attributes, remote_srp_attributes) = {
+ let state = signup_state.lock().unwrap();
+ (
+ state.uploaded_key_attributes.clone().unwrap(),
+ state.remote_srp_attributes.clone().unwrap(),
+ )
+ };
assert_eq!(created.user_id, 99);
assert_eq!(created.secrets.token, signup_token_bytes);