fix(gateway): synchronize qualification stage evidence
This commit is contained in:
@@ -2,6 +2,7 @@ package gateway
|
||||
|
||||
import (
|
||||
"compress/gzip"
|
||||
"encoding/binary"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -142,6 +143,29 @@ func TestQualificationProcessingPreservesPayload(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestQualificationRepeatedTraversalTracksEveryProductionStage(t *testing.T) {
|
||||
profile := qualificationMediaProfiles()[0]
|
||||
pacerKbps := (profile.BitrateKbps*int64(profile.PacketBytes+frameHeaderSize) + int64(profile.PacketBytes) - 1) / int64(profile.PacketBytes)
|
||||
path := newQualificationPath(t, profile, pacerKbps)
|
||||
payload := qualificationPayload(profile)
|
||||
if err := runQualificationWarmup(t, path, profile, payload); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for index := 0; index < 10_000; index++ {
|
||||
current := append([]byte(nil), payload...)
|
||||
binary.BigEndian.PutUint32(current[len(current)-4:], uint32(index))
|
||||
trace, _, err := path.traverse(t, current)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !trace.NativeUDPIngress || !trace.ApolloRecovered || !trace.ProductionQueue ||
|
||||
!trace.ProductionMediaLoop || !trace.ProductionPacer || !trace.VerseQUIC ||
|
||||
!trace.PublicClientDecode || !trace.PayloadPreserved {
|
||||
t.Fatalf("traversal %d missed a production stage: %#v", index, trace)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestQualificationImpairmentIsDeterministicAndBounded(t *testing.T) {
|
||||
profile := qualificationImpairmentProfiles()[3]
|
||||
first, err := runQualificationImpairment(t, profile, qualificationMediaProfiles()[0], 1000, filepath.Join(t.TempDir(), "first.csv.gz"))
|
||||
|
||||
Reference in New Issue
Block a user