Skip to content

Commit 88f5844

Browse files
committed
Adds timeouts to ConnectionFullStackTests
1 parent 8370073 commit 88f5844

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

FullStackTests/Tests/ConnectionFullStackTests.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ struct ConnectionFullStackTests {
2323

2424
typealias Connection = USBSmartCardConnection
2525

26-
@Test("Single Connection")
26+
@Test("Single Connection", .timeLimit(.minutes(1)))
2727
func singleConnection() async throws {
2828
let connection = try await Connection.connection()
2929
#expect(true, "✅ Got connection \(connection)")
3030
await connection.close(error: nil)
3131
}
3232

33-
@Test("Serial Connections")
33+
@Test("Serial Connections", .timeLimit(.minutes(1)))
3434
func serialConnections() async throws {
3535
let firstConnection = try await Connection.connection()
3636
#expect(true, "✅ Got first connection \(firstConnection)")
@@ -59,7 +59,7 @@ struct ConnectionFullStackTests {
5959
await secondConnection.close(error: nil)
6060
}
6161

62-
@Test("Connection Cancellation")
62+
@Test("Connection Cancellation", .timeLimit(.minutes(1)))
6363
func connectionCancellation() async {
6464
let task1 = Task {
6565
try await Connection.connection()
@@ -90,7 +90,7 @@ struct ConnectionFullStackTests {
9090
await connections.first?.close(error: nil)
9191
}
9292

93-
@Test("Send Manually")
93+
@Test("Send Manually", .timeLimit(.minutes(1)))
9494
func sendManually() async throws {
9595
let connection = try await Connection.connection()
9696
// Select Management application
@@ -142,15 +142,15 @@ struct ConnectionFullStackTests {
142142
@Suite("NFC Full Stack Tests", .serialized)
143143
struct NFCFullStackTests {
144144

145-
@Test("NFC Alert Message")
145+
@Test("NFC Alert Message", .timeLimit(.minutes(1)))
146146
func nfcAlertMessage() async throws {
147147
let connection = try await TestableConnections.create(with: .nfc(alertMessage: "Test Alert Message"))
148148
await connection.nfcConnection?.setAlertMessage("Updated Alert Message")
149149
try? await Task.sleep(for: .seconds(1))
150150
await connection.nfcConnection?.close(message: "Closing Alert Message")
151151
}
152152

153-
@Test("NFC Closing Error Message")
153+
@Test("NFC Closing Error Message", .timeLimit(.minutes(1)))
154154
func nfcClosingErrorMessage() async throws {
155155
let connection = try await TestableConnections.create(with: .nfc(alertMessage: "Test Alert Message"))
156156
await connection.close(error: nil)
@@ -162,7 +162,7 @@ struct NFCFullStackTests {
162162
@Suite("SmartCard Connection Full Stack Tests", .serialized)
163163
struct SmartCardConnectionFullStackTests {
164164

165-
@Test("SmartCard Connection With Slot")
165+
@Test("SmartCard Connection With Slot", .timeLimit(.minutes(1)))
166166
func smartCardConnectionWithSlot() async throws {
167167
let allSlots = try await USBSmartCardConnection.availableSlots
168168
allSlots.enumerated().forEach { index, slot in

0 commit comments

Comments
 (0)