Skip to content

Commit 18eb5aa

Browse files
authored
fix: amplify publisher tests (#2453)
1 parent 7305b35 commit 18eb5aa

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

AmplifyTests/CoreTests/AmplifyPublisherTests.swift

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,10 @@ class AmplifyPublisherTests: XCTestCase {
208208
output.append(value)
209209
}
210210

211-
await waitForExpectations(timeout: 1)
212-
XCTAssertEqual(expected, output)
211+
await waitForExpectations(timeout: 3)
212+
for element in output {
213+
XCTAssertTrue(expected.contains(element))
214+
}
213215
sink.cancel()
214216
}
215217

@@ -232,8 +234,10 @@ class AmplifyPublisherTests: XCTestCase {
232234
output.append(value)
233235
}
234236

235-
await waitForExpectations(timeout: 1)
236-
XCTAssertEqual(expected, output)
237+
await waitForExpectations(timeout: 3)
238+
for element in output {
239+
XCTAssertTrue(expected.contains(element))
240+
}
237241
sink.cancel()
238242
}
239243

@@ -332,6 +336,7 @@ class AmplifyPublisherTests: XCTestCase {
332336
var current = 1
333337

334338
mutating func next() async throws -> Element? {
339+
try? await Task.sleep(nanoseconds: 500)
335340
defer { current *= 2 }
336341
if current > 16 {
337342
return nil

0 commit comments

Comments
 (0)