Skip to content

Commit 55a8fe2

Browse files
committed
tests: fix search tests
1 parent 96b424e commit 55a8fe2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

CodeEditTests/Features/Documents/WorkspaceDocument+SearchState+FindAndReplaceTests.swift

+6-4
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,13 @@ final class FindAndReplaceTests: XCTestCase {
9999
// IMPORTANT:
100100
// This is only a temporary solution, in the feature a file watcher would track the file update
101101
// and trigger a index update.
102-
Task {
103-
await searchState.addProjectToIndex()
104-
}
102+
await searchState.addProjectToIndex()
105103
let startTime = Date()
106-
while searchState.indexStatus != .done {
104+
while true {
105+
let indexState = searchState.indexStatus
106+
if indexState == .done {
107+
return
108+
}
107109
try? await Task.sleep(nanoseconds: 100_000_000)
108110
if Date().timeIntervalSince(startTime) > 2.0 {
109111
XCTFail("TIMEOUT: Indexing took to long or did not complete.")

0 commit comments

Comments
 (0)