Skip to content

Commit

Permalink
fix(tests): raise timeouts slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
Akazm committed Dec 17, 2024
1 parent 3ad3e71 commit 30980ba
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Sources/Tests/HIDEventDispatcherTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ import Testing
observedPrequisites.append(prequisite)
}
}
try? await Task.sleep(seconds: 0.5)
try? await Task.sleep(seconds: 0.75)
eventSource.raise(
eventOfType: .tapDisabledByTimeout,
event: .init(keyboardEventSource: nil, virtualKey: 16, keyDown: false)!
)
try? await Task.sleep(seconds: 0.5)
try? await Task.sleep(seconds: 0.75)
let latestValues = observedPrequisites.suffix(2)
#expect(latestValues.first?.contains(.enabled) == false && latestValues.last?.contains(.enabled) == true)
#expect(latestValues.first?.contains(.enabled) == false)
#expect(latestValues.last?.contains(.enabled) == true)
receiver.remove()
observationTask.cancel()
}
Expand Down Expand Up @@ -127,6 +128,7 @@ import Testing
event: .init(keyboardEventSource: nil, virtualKey: 16, keyDown: true)!
)
task.cancel()
try? await Task.sleep(seconds: 0.2)
#expect(dispatcher.getActiveReceivers().isEmpty)
}

Expand Down

0 comments on commit 30980ba

Please sign in to comment.