Skip to content

Commit

Permalink
Flaky-tests-fix (#64)
Browse files Browse the repository at this point in the history
* fix

* another timeout fix

* bumped timeout

* action fix
  • Loading branch information
KazaiMazai authored Sep 2, 2024
1 parent 0af1a91 commit ac614a5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ extension StoreViewDeduplicationPropsTests {
store.dispatch(0, after: Double(idx) * actionDelay)
}

waitForExpectations(timeout: timeout)
waitForExpectations(timeout: 3 * actionDelay * Double(actionsCount))
}

func test_WhenManyMutatingActions_ThenPropsEvaluatedForEveryDeduplicatedMutation() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Dispatch

final class StoreViewNoDeduplicationPropsTests: XCTestCase {
let timeout: TimeInterval = 4
let actionDelay: TimeInterval = 0.2
let actionDelay: TimeInterval = 0.3
@StoreOf(\.rootStore) var store

@discardableResult func setupWindowForTests(propsEvaluatedExpectation: XCTestExpectation) -> UIWindow {
Expand Down Expand Up @@ -56,7 +56,7 @@ extension StoreViewNoDeduplicationPropsTests {
store.dispatch(0, after: (Double(idx) * actionDelay))
}

waitForExpectations(timeout: timeout)
waitForExpectations(timeout: 2 * (Double(actionsCount) * actionDelay))
}

func test_WhenManyMutatingActionsAndDeduplicateNeverEqual_ThenEvaluatedForEveryAction() {
Expand All @@ -70,6 +70,6 @@ extension StoreViewNoDeduplicationPropsTests {
store.dispatch(idx, after: (Double(idx) * actionDelay))
}

waitForExpectations(timeout: timeout)
waitForExpectations(timeout: 4 * (Double(actionsCount) * actionDelay))
}
}
2 changes: 1 addition & 1 deletion Tests/PureduxTests/TestUtils/TestRootAppStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import SwiftUI
import UIKit

extension Injected {
@InjectEntry var rootStore = StateStore<Int, Int>(0) { state, action in state += 1 }
@InjectEntry var rootStore = StateStore<Int, Int>(0) { state, action in state += action }

}

0 comments on commit ac614a5

Please sign in to comment.