Skip to content

Commit 0694ccd

Browse files
committed
Fix testRunDetached
This test failed for me when it happened to encounter a 6-digit process ID.
1 parent 9e38d01 commit 0694ccd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Tests/SubprocessTests/SubprocessTests+Windows.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,8 @@ extension SubprocessWindowsTests {
790790
// Wait for the process to finish
791791
WaitForSingleObject(processHandle, INFINITE)
792792

793-
let data = try await readFd.readUntilEOF(upToLength: 5)
793+
// Up to 10 characters because Windows process IDs are DWORDs (UInt32), whose max value is 10 digits.
794+
let data = try await readFd.readUntilEOF(upToLength: 10)
794795
let resultPID = try #require(
795796
String(data: data, encoding: .utf8)
796797
).trimmingCharacters(in: .whitespacesAndNewlines)

0 commit comments

Comments
 (0)