File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Sources/swift-parser-test Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -231,7 +231,7 @@ class Reduce: ParsableCommand {
231
231
}
232
232
233
233
try process. run ( )
234
- if sema. wait ( timeout: DispatchTime . now ( ) + . seconds( 1 ) ) == . timedOut {
234
+ if sema. wait ( timeout: DispatchTime . now ( ) + . seconds( 2 ) ) == . timedOut {
235
235
#if os(Windows)
236
236
_ = TerminateProcess ( process. processHandle, 0 )
237
237
#else
@@ -265,6 +265,10 @@ class Reduce: ParsableCommand {
265
265
var reduced = source
266
266
var chunkSize = source. count / 4
267
267
while chunkSize > 0 {
268
+ if chunkSize < reduced. count / 20 {
269
+ // The chunk sizes are really tiny compared to the source file. Looks like we aren't making any progress reducing. Abort.
270
+ break
271
+ }
268
272
if verbose {
269
273
printerr ( " Current source size \( reduced. count) , reducing with chunk size \( chunkSize) " )
270
274
}
You can’t perform that action at this time.
0 commit comments