From 9e550191aa8622f792900fa42f8cdf720967674e Mon Sep 17 00:00:00 2001 From: James Sherlock <15193942+Sherlouk@users.noreply.github.com> Date: Thu, 28 Sep 2023 20:32:34 +0100 Subject: [PATCH] Apply Fix for testDeleteAllDocuments Other solutions include: - fetching all documents and asserting total count - deleting all documents before adding again (expect 8) - create a new index just for this one test --- Tests/MeiliSearchIntegrationTests/DocumentsTests.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tests/MeiliSearchIntegrationTests/DocumentsTests.swift b/Tests/MeiliSearchIntegrationTests/DocumentsTests.swift index 1eed3de9..ff95cb18 100755 --- a/Tests/MeiliSearchIntegrationTests/DocumentsTests.swift +++ b/Tests/MeiliSearchIntegrationTests/DocumentsTests.swift @@ -366,7 +366,9 @@ class DocumentsTests: XCTestCase { XCTAssertEqual(Task.Status.succeeded, task.status) XCTAssertEqual("documentDeletion", task.type.description) if case .documentDeletion(let details) = task.details { - XCTAssertEqual(8, details.deletedDocuments) + // It's possible for this to number to be greater than 8 (the number of documents we have inserted) due + // to other integration tests populating the shared index. + XCTAssertGreaterThanOrEqual(details.deletedDocuments ?? -1, 8) } else { XCTFail("documentDeletion details should be set by task") }