diff --git a/tests/integration_document_deletion_integration_tests.rs b/tests/integration_document_deletion_integration_tests.rs index b9cb5aa..af36151 100644 --- a/tests/integration_document_deletion_integration_tests.rs +++ b/tests/integration_document_deletion_integration_tests.rs @@ -281,8 +281,11 @@ impl DocumentDeletionTestClient { /// Create and login user (convenience method) async fn create_and_login_user(&mut self, username: &str, password: &str, role: UserRole) -> Result> { - let email = format!("{}@example.com", username); - self.register_and_login(username, &email, password, Some(role)).await + // Add random suffix to avoid username collisions between parallel tests + let random_suffix = uuid::Uuid::new_v4().to_string().chars().take(8).collect::(); + let unique_username = format!("{}_{}", username, random_suffix); + let email = format!("{}@example.com", unique_username); + self.register_and_login(&unique_username, &email, password, Some(role)).await } }