You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
parse_cgroup (the k8s identity heart) was untested: add containerd pod+container, docker
container-only, and bare-host cases (covers the '_'->'-' pod-UID rewrite + short-id). Also a
JsonExporter test exercising the v0.9.2 non-blocking writer-thread path (export/new/output_drops).
traits.rs 63->74%, lib total 72->78%; lib tests 6->10.
let k = parse_cgroup("0::/user.slice/user-1000.slice/session-2.scope\n");
308
+
assert!(k.pod_uid.is_none());
309
+
assert!(k.container_id.is_none());
310
+
}
311
+
312
+
#[test]
313
+
fnjson_exporter_export_is_nonblocking(){
314
+
usecrate::model::AgentEvent;
315
+
let ex = JsonExporter::new();
316
+
let ev = EnrichedEvent{
317
+
identity:Identity{
318
+
agent:Some("agent-x".into()),
319
+
task:Some("1".into()),
320
+
session:None,
321
+
},
322
+
provider:None,
323
+
event:AgentEvent::ProcessExit{
324
+
pid:1,
325
+
exit_code:0,
326
+
},
327
+
};
328
+
for _ in0..50{
329
+
ex.export(&ev);
330
+
}
331
+
assert_eq!(ex.output_drops(),0);// 50 << queue cap → nothing dropped, never blocks
332
+
}
333
+
282
334
#[test]
283
335
fncgroup_parse_containerd_docker_bare(){
284
336
let cd = "0::/kubepods.slice/kubepods-besteffort.slice/kubepods-besteffort-pod1a2b3c4d_5e6f_7890_abcd_ef1234567890.slice/cri-containerd-abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789.scope";
0 commit comments