feat(agent): omit sslocal log timestamps

This commit is contained in:
Qiu Yuzhou
2026-10-24 00:13:58 +08:00
parent 4845cbf673
commit 1262d17d61
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -83,7 +83,7 @@ func spawnSslocal() -> Process? {
if data.isEmpty { handle.readabilityHandler = nil }
}
child.executableURL = sslocalURL
child.arguments = ["-c", contractURL.path]
child.arguments = ["-c", contractURL.path, "--log-without-time"]
var childEnvironment = environment
// 不配置 sslocal 日志级别;未设置时使用上游默认值,显式外部 RUST_LOG 原样透传。
// macOS 的 resolv.conf 可能含带 zone id 的链路本地 nameserver(RA 下发的
@@ -171,10 +171,13 @@ final class AgentLifecycleCoreTests: AgentLifecycleTests {
func testStartProtocolSpawnsSslocalWithAbsoluteConfigPathThenStopsOnSIGTERM() throws {
try writeContract(ProxyRuntimeFixture.makeDocument())
let wrapper = try launchWrapper(behavior: "run")
let expectedInvocation = "invoked: -c \(contractURL.path) --log-without-time"
XCTAssertTrue(
try waitUntil { self.stateLog().contains("invoked: -c \(self.contractURL.path)") },
"wrapper 应以契约绝对路径调用 sslocal,实际:\(stateLog())")
try waitUntil {
self.stateLog().components(separatedBy: .newlines).contains(expectedInvocation)
},
"wrapper 应以契约绝对路径及无上游时间参数调用 sslocal,实际:\(stateLog())")
XCTAssertTrue(pidAlive(wrapper.processIdentifier), "sslocal 运行期间 wrapper 应保持常驻")
XCTAssertThrowsError(try waitForExit(wrapper, timeout: 0.01))