From 971f9b69e0b4d4c8c779ba4f6c00690375e5f1d9 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Sat, 28 Jun 2025 22:58:20 +0000 Subject: [PATCH] fix(tests): fix failing document integration test, again --- tests/integration_document_deletion_integration_tests.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 } }