fix(gateway): sustain qualified media traversal
Verify Data Plane / gateway (push) Successful in 5m4s

This commit is contained in:
sechmachine
2026-07-30 17:36:31 +07:00
parent 78e4709c90
commit df23f5edc1
6 changed files with 63 additions and 30 deletions
+18 -3
View File
@@ -109,7 +109,8 @@ func TestQualificationShortProcessingWritesRawArtifact(t *testing.T) {
}
if summary.Count < 1 || summary.RawSamplesSHA256 == "" || summary.RawSamplesBytes < 1 ||
summary.ResourceSamples < 2 || summary.RawResourcesSHA256 == "" || summary.RawResourcesBytes < 1 ||
summary.CPUScope != qualificationGatewayCPUScope || summary.ClockOverhead <= 0 || summary.ClockMethod == "" {
summary.CPUScope != qualificationGatewayCPUScope || summary.ResourceMethod != qualificationResourceMethod ||
summary.ClockOverhead <= 0 || summary.ClockMethod == "" {
t.Fatalf("processing summary = %#v", summary)
}
file, err := os.Open(rawPath)
@@ -151,6 +152,20 @@ func TestQualificationShortProcessingSubprocessCoversFixedProfiles(t *testing.T)
}
}
func TestQualificationSustainedProcessingKeepsCleanPathBounded(t *testing.T) {
profile := qualificationMediaProfiles()[2]
profile.Duration = 2 * time.Minute
profile.Warmup = 100 * time.Millisecond
summary, err := runQualificationProcessing(t, profile, filepath.Join(t.TempDir(), "4k60-hevc.csv.gz"))
if err != nil {
t.Fatal(err)
}
if summary.Count < 1 || summary.ObservedBitrateKbps < float64(profile.BitrateKbps)*0.95 ||
summary.ObservedBitrateKbps > float64(profile.BitrateKbps)*1.05 {
t.Fatalf("sustained processing summary = %#v", summary)
}
}
func TestQualificationProcessingResourcesExcludeParentDriverCPU(t *testing.T) {
profile := qualificationMediaProfile{
Name: "resource-isolation", Codec: "h264", BitrateKbps: 1000,
@@ -429,11 +444,11 @@ func TestQualificationGatewaySubprocessResourcesResetAndTrackWork(t *testing.T)
if idle.CPUSeconds > 50*time.Millisecond.Seconds() || secondIdle.CPUSeconds > 50*time.Millisecond.Seconds() {
t.Fatalf("idle gateway CPU was reported as consumed work: first=%.6fs second=%.6fs", idle.CPUSeconds, secondIdle.CPUSeconds)
}
if work.CPUSeconds <= idle.CPUSeconds || work.Count != 500 || work.Mallocs == 0 ||
if work.CPUSeconds <= idle.CPUSeconds || work.Count != 500 || work.AllocatedObjects == 0 ||
work.AllocatedBytes == 0 || work.PeakHeapBytes == 0 || work.PeakGoroutines == 0 {
t.Fatalf("gateway work resource sample = %#v idle=%#v", work, idle)
}
if secondIdle.Mallocs >= work.Mallocs || secondIdle.AllocatedBytes >= work.AllocatedBytes {
if secondIdle.AllocatedObjects >= work.AllocatedObjects || secondIdle.AllocatedBytes >= work.AllocatedBytes {
t.Fatalf("successive recording inherited counters: work=%#v second=%#v", work, secondIdle)
}
if work.ClockOverhead <= 0 || work.ClockMethod != qualificationClockOverheadMethod {