Skip to content

Commit

Permalink
Fix a data race in unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
ianthetechie authored and dependabot[bot] committed Nov 4, 2024
1 parent a0639c7 commit 27dab0b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ jobs:
working-directory: android

test:

runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-android-test
Expand Down
5 changes: 5 additions & 0 deletions apple/Tests/FerrostarCoreTests/FerrostarCoreTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,11 @@ final class FerrostarCoreTests: XCTestCase {
await fulfillment(of: [routeDeviationCallbackExp], timeout: 1.0)
await fulfillment(of: [loadedAltRoutesExp], timeout: 1.0)

// At this point, there is a brief window where the delegate call loading alternate routes has completed,
// but the state is still updating. This is a quick hack to fix the tests
// in the absence of something more reliable.
try? await Task.sleep(nanoseconds: NSEC_PER_SEC / 10)

XCTAssert(core.state?.isCalculatingNewRoute == false, "Expected to no longer be calculating a new route")
}

Expand Down

0 comments on commit 27dab0b

Please sign in to comment.