Skip to content
Merged
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
10 changes: 8 additions & 2 deletions cmuxTests/SSHForegroundAuthenticationMarkerCleanupTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,25 @@ struct SSHForegroundAuthenticationMarkerCleanupTests {
defer {
Darwin.kill(childPID, SIGKILL)
}
let signaledAt = Date()
Darwin.kill(process.processIdentifier, SIGINT)

let exitDeadline = Date().addingTimeInterval(3)
// Cleanup gets a 2s discovery window plus a bounded force pass. The
// child's TERM handler runs promptly, but the post-TERM process-table
// snapshots can outlast 3s on a loaded runner. 15s matches the
// tolerance of the policy's own cleanup-deadline regression test.
let exitDeadline = signaledAt.addingTimeInterval(15)
while process.isRunning, Date() < exitDeadline {
Thread.sleep(forTimeInterval: 0.01)
}
let exited = !process.isRunning
let elapsed = Date().timeIntervalSince(signaledAt)
if process.isRunning {
Darwin.kill(process.processIdentifier, SIGKILL)
}
process.waitUntilExit()

#expect(exited)
#expect(exited, "Restored attach did not exit \(elapsed)s after SIGINT")
if exited {
#expect(process.terminationStatus == 130)
}
Expand Down
Loading