test(gateway): observe qualification batch pacing
Verify Data Plane / gateway (push) Failing after 1m31s

This commit is contained in:
sechmachine
2026-08-09 16:16:04 +07:00
parent aa4f948fbc
commit a491c4f733
2 changed files with 44 additions and 18 deletions
+21 -17
View File
@@ -414,22 +414,23 @@ func (b *qualificationTracingBackend) session(sessionID string) *nativeApolloSes
}
type qualificationApolloFixture struct {
sessionID string
management *httptest.Server
stream net.Listener
control *net.UDPConn
audio *net.UDPConn
video *net.UDPConn
videoRemote atomic.Pointer[net.UDPAddr]
key atomic.Pointer[[]byte]
keyReady chan []byte
failures chan error
closed atomic.Bool
closeOnce sync.Once
sentPackets atomic.Uint64
work protocol.ProviderSessionWork
videoPaceMu sync.Mutex
videoNext time.Time
sessionID string
management *httptest.Server
stream net.Listener
control *net.UDPConn
audio *net.UDPConn
video *net.UDPConn
videoRemote atomic.Pointer[net.UDPAddr]
key atomic.Pointer[[]byte]
keyReady chan []byte
failures chan error
closed atomic.Bool
closeOnce sync.Once
sentPackets atomic.Uint64
work protocol.ProviderSessionWork
videoPaceMu sync.Mutex
videoNext time.Time
observeVideoBatch func(int, time.Time)
controlImpairmentMu sync.Mutex
controlRTT time.Duration
@@ -775,11 +776,14 @@ func (f *qualificationApolloFixture) sendVideo(ctx context.Context, packets [][]
}
framePackets := 0
for batchStart := 0; batchStart < len(packets); batchStart += batchSize {
batchEnd := min(batchStart+batchSize, len(packets))
due := frameStart.Add(qualificationApolloVideoOffset(framePackets, packetsPerMillisecond))
if err := qualificationWaitContext(ctx, due); err != nil {
return err
}
batchEnd := min(batchStart+batchSize, len(packets))
if f.observeVideoBatch != nil {
f.observeVideoBatch(framePackets, time.Now())
}
for _, packet := range packets[batchStart:batchEnd] {
if len(packet) != len(packets[0]) {
return ErrProviderMalformed