import Foundation /// Saturates the CPU with busy processes for the duration of a test run, approximating /// a loaded CI runner where timing-sensitive tests are starved of processor time. final class CPUConstraint { private var processes = [Process]() /// 2× the machine's cores is enough to keep the scheduler permanently oversubscribed. private let taskCount = ProcessInfo.processInfo.processorCount * 2 func start() { logger.info("\n🐌 Constraining the CPU with \(taskCount) tasks…\n") for _ in 0..