Skip to content

Commit

Permalink
Try to fix brittle test in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
p4checo committed Jan 31, 2023
1 parent d0ec829 commit 0d6f470
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,17 @@ final class EffectCancellationTests: XCTestCase {
func testCancellationAfterDelay() {
var value: Int?

let scheduler = QueueScheduler()

Effect(value: 1)
.deferred(for: 0.5, scheduler: QueueScheduler.main)
.deferred(for: 0.5, scheduler: scheduler)
.cancellable(id: CancelID())
.producer
.startWithValues { value = $0 }

XCTAssertEqual(value, nil)

DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) {
scheduler.queue.asyncAfter(deadline: .now() + 0.05) {
_ = EffectTask<Never>.cancel(id: CancelID())
.producer
.start()
Expand Down

0 comments on commit 0d6f470

Please sign in to comment.