Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Sources/Services/MachineAPIService/Client/MachineClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public struct MachineClient: Sendable {

let response = try await xpcSend(
message: request,
timeout: .seconds(10)
timeout: nil
)
let data = response.dataNoCopy(key: MachineKeys.machines.rawValue)
guard let data else {
Expand Down Expand Up @@ -142,7 +142,7 @@ public struct MachineClient: Sendable {
let bootData = try JSONEncoder().encode(bootConfig)
request.set(key: MachineKeys.bootConfig.rawValue, value: bootData)

let _ = try await xpcSend(message: request)
let _ = try await xpcSend(message: request, timeout: nil)
} catch {
throw ContainerizationError(
.internalError,
Expand All @@ -158,7 +158,7 @@ public struct MachineClient: Sendable {
let request = XPCMessage(route: MachineRoutes.deleteMachine.rawValue)
request.set(key: MachineKeys.id.rawValue, value: id)

let _ = try await xpcSend(message: request, timeout: .seconds(15))
let _ = try await xpcSend(message: request, timeout: .seconds(60))
} catch {
throw ContainerizationError(
.internalError,
Expand Down Expand Up @@ -216,7 +216,7 @@ public struct MachineClient: Sendable {
let dynamicEnvData = try JSONEncoder().encode(dynamicEnv)
request.set(key: MachineKeys.dynamicEnv.rawValue, value: dynamicEnvData)

let response = try await xpcSend(message: request)
let response = try await xpcSend(message: request, timeout: nil)
guard let data = response.dataNoCopy(key: MachineKeys.snapshot.rawValue) else {
throw ContainerizationError(
.internalError,
Expand All @@ -239,7 +239,7 @@ public struct MachineClient: Sendable {
let request = XPCMessage(route: MachineRoutes.stopMachine.rawValue)
request.set(key: MachineKeys.id.rawValue, value: id)

let _ = try await xpcSend(message: request, timeout: .seconds(30))
let _ = try await xpcSend(message: request, timeout: nil)
} catch {
throw ContainerizationError(
.internalError,
Expand Down Expand Up @@ -272,7 +272,7 @@ public struct MachineClient: Sendable {
let request = XPCMessage(route: MachineRoutes.inspectMachine.rawValue)
request.set(key: MachineKeys.id.rawValue, value: id)

let response = try await xpcSend(message: request)
let response = try await xpcSend(message: request, timeout: nil)
guard let data = response.dataNoCopy(key: MachineKeys.snapshot.rawValue) else {
throw ContainerizationError(
.internalError,
Expand Down
24 changes: 11 additions & 13 deletions Tests/IntegrationTests/Machine/TestCLIMachineCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,17 @@ struct TestCLIMachineCommand {
}
}

@Test func testCreateNameLongestValid() async {
await withKnownIssue("XPC timeout on machine-apiserver.bootMachine", isIntermittent: true) {
try await ContainerFixture.with { f in
// Start with container ID or DNS label length, whichever is shorter.
// Reduce by length of UUID suffix.
// Reduce by 1 for dash separator between ID and suffix.
let maxHostnameLength = min(LinuxContainer.maxIDLength, 63)
let maxNameLength = maxHostnameLength - MachineConfiguration.containerUUIDLength - 2
let name = String(repeating: "a", count: maxNameLength)
f.addCleanup { f.cleanupMachine(name) }
try f.doMachineCreate(name: name, image: machineImage)
try f.doMachineBoot(name: name)
}
@Test func testCreateNameLongestValid() async throws {
try await ContainerFixture.with { f in
// Start with container ID or DNS label length, whichever is shorter.
// Reduce by length of UUID suffix.
// Reduce by 1 for dash separator between ID and suffix.
let maxHostnameLength = min(LinuxContainer.maxIDLength, 63)
let maxNameLength = maxHostnameLength - MachineConfiguration.containerUUIDLength - 2
let name = String(repeating: "a", count: maxNameLength)
f.addCleanup { f.cleanupMachine(name) }
try f.doMachineCreate(name: name, image: machineImage)
try f.doMachineBoot(name: name)
}
}

Expand Down