Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Niall Brennan committed Oct 4, 2023
1 parent 19dda64 commit d9c8be3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Tests/Segment-Tests/FlushPolicy_Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,16 @@ class FlushPolicyTests: XCTestCase {
// make sure storage has no old events
analytics.storage.hardReset(doYouKnowHowToUseThis: true)

let intervalFlush = IntervalBasedFlushPolicy(interval: 4)
let intervalFlush = IntervalBasedFlushPolicy(interval: 2)
analytics.add(flushPolicy: intervalFlush)

waitUntilStarted(analytics: analytics)
analytics.track(name: "blah", properties: nil)

XCTAssertTrue(analytics.hasUnsentEvents)

// sleep for 5 seconds for 4 second flush policy
RunLoop.main.run(until: Date.init(timeIntervalSinceNow: 6))
// sleep for 4 seconds for 2 second flush policy
RunLoop.main.run(until: Date.init(timeIntervalSinceNow: 4))

XCTAssertFalse(analytics.hasUnsentEvents)
}
Expand Down

0 comments on commit d9c8be3

Please sign in to comment.