Skip to content

Commit

Permalink
Fixed test to account for deadlock fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
bsneed committed Apr 11, 2024
1 parent 5426306 commit 8dd0a04
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Tests/SwiftAudioExTests/NowPlayingInfoTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ class NowPlayingInfoTests: XCTestCase {

func testNowPlayingInfoControllerPlaybackValuesUpdate() {
let item = LongSource.getAudioItem()

// State has become somewhat async to prevent a deadlock,
// so this isn't instantaneous anymore and needs a teensy bit of time.
audioPlayer.load(item: item, playWhenReady: true)

RunLoop.current.run(until: Date(timeIntervalSinceNow: 1))

XCTAssertNotNil(nowPlayingController.getRate())
XCTAssertNotNil(nowPlayingController.getDuration())
Expand Down

0 comments on commit 8dd0a04

Please sign in to comment.