Skip to content

Commit

Permalink
[tests] Operation Repo polling is too quick for test
Browse files Browse the repository at this point in the history
* Some tests require more time for the user updates to enqueue before the flush
  • Loading branch information
nan-li committed May 29, 2024
1 parent 5c37734 commit f1a986d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ import XCTest
import OneSignalCore
import OneSignalCoreMocks
import OneSignalUserMocks
import OneSignalOSCore
// Testable import OSCore to allow setting a different poll flush interval
@testable import OneSignalOSCore
@testable import OneSignalUser

final class OneSignalUserTests: XCTestCase {
Expand Down Expand Up @@ -152,6 +153,9 @@ final class OneSignalUserTests: XCTestCase {
MockUserRequests.setDefaultCreateAnonUserResponses(with: client)
OneSignalCoreImpl.setSharedClient(client)

// Increase flush interval to allow all the updates to batch
OSOperationRepo.sharedInstance.pollIntervalMilliseconds = 300

/* When */

OneSignalUserManagerImpl.sharedInstance.sendSessionTime(100)
Expand Down

0 comments on commit f1a986d

Please sign in to comment.