Skip to content

Commit

Permalink
Apply fix for unit test
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Sherlouk committed Sep 28, 2023
1 parent f10885c commit 4bcee63
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Tests/MeiliSearchIntegrationTests/DocumentsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit 4bcee63

Please sign in to comment.