Skip to content

Commit

Permalink
filter out expected signals when logging test crashing
Browse files Browse the repository at this point in the history
motivation: nicer user experience when terminating tests

changes: filter out logging of signal used when terminating tests normally

radar/113751498
  • Loading branch information
tomerd committed Oct 4, 2023
1 parent 9799a78 commit fcad109
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Sources/Commands/SwiftTestTool.swift
Expand Up @@ -14,9 +14,7 @@ import ArgumentParser
import Basics
import CoreCommands
import Dispatch
import class Foundation.JSONDecoder
import class Foundation.NSLock
import class Foundation.ProcessInfo
import Foundation
import PackageGraph
import PackageModel
import SPMBuildCore
Expand Down Expand Up @@ -698,8 +696,8 @@ final class TestRunner {
case .terminated(code: 0):
return true
#if !os(Windows)
case .signalled(let signal):
testObservabilityScope.emit(error: "Exited with signal code \(signal)")
case .signalled(let signal) where ![SIGINT, SIGKILL, SIGTERM].contains(signal):
testObservabilityScope.emit(error: "Exited with unexpected signal code \(signal)")
return false
#endif
default:
Expand Down

0 comments on commit fcad109

Please sign in to comment.