fix(gateway): accept positive traversal counter deltas
This commit is contained in:
@@ -144,14 +144,14 @@ func TestQualificationProcessingPreservesPayload(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestQualificationRepeatedTraversalTracksEveryProductionStage(t *testing.T) {
|
func TestQualificationRepeatedTraversalTracksEveryProductionStage(t *testing.T) {
|
||||||
profile := qualificationMediaProfiles()[0]
|
profile := qualificationMediaProfiles()[1]
|
||||||
pacerKbps := (profile.BitrateKbps*int64(profile.PacketBytes+frameHeaderSize) + int64(profile.PacketBytes) - 1) / int64(profile.PacketBytes)
|
pacerKbps := (profile.BitrateKbps*int64(profile.PacketBytes+frameHeaderSize) + int64(profile.PacketBytes) - 1) / int64(profile.PacketBytes)
|
||||||
path := newQualificationPath(t, profile, pacerKbps)
|
path := newQualificationPath(t, profile, pacerKbps)
|
||||||
payload := qualificationPayload(profile)
|
payload := qualificationPayload(profile)
|
||||||
if err := runQualificationWarmup(t, path, profile, payload); err != nil {
|
if err := runQualificationWarmup(t, path, profile, payload); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
for index := 0; index < 10_000; index++ {
|
for index := 0; index < 25_000; index++ {
|
||||||
current := append([]byte(nil), payload...)
|
current := append([]byte(nil), payload...)
|
||||||
binary.BigEndian.PutUint32(current[len(current)-4:], uint32(index))
|
binary.BigEndian.PutUint32(current[len(current)-4:], uint32(index))
|
||||||
trace, _, err := path.traverse(t, current)
|
trace, _, err := path.traverse(t, current)
|
||||||
|
|||||||
@@ -842,7 +842,7 @@ func (p *qualificationPath) traverse(t *testing.T, payload []byte) (qualificatio
|
|||||||
trace.NativeUDPIngress = p.session.mediaIngress.Load() > beforeIngress
|
trace.NativeUDPIngress = p.session.mediaIngress.Load() > beforeIngress
|
||||||
trace.ApolloRecovered = p.session.mediaRecovered.Load() > beforeRecovered
|
trace.ApolloRecovered = p.session.mediaRecovered.Load() > beforeRecovered
|
||||||
trace.ProductionQueue = p.session.mediaEnqueued.Load() > beforeEnqueued
|
trace.ProductionQueue = p.session.mediaEnqueued.Load() > beforeEnqueued
|
||||||
trace.ProductionMediaLoop = afterMetrics.ProcessingSamples == beforeMetrics.ProcessingSamples+1
|
trace.ProductionMediaLoop = afterMetrics.ProcessingSamples > beforeMetrics.ProcessingSamples
|
||||||
trace.ProductionPacer = p.server.pacer.reservations.Load() > beforePacer
|
trace.ProductionPacer = p.server.pacer.reservations.Load() > beforePacer
|
||||||
trace.VerseQUIC = afterMetrics.MediaPackets > beforeMetrics.MediaPackets
|
trace.VerseQUIC = afterMetrics.MediaPackets > beforeMetrics.MediaPackets
|
||||||
trace.PublicClientDecode = true
|
trace.PublicClientDecode = true
|
||||||
@@ -1335,7 +1335,7 @@ func runQualificationProcessing(t *testing.T, profile qualificationMediaProfile,
|
|||||||
if !trace.NativeUDPIngress || !trace.ApolloRecovered || !trace.ProductionQueue ||
|
if !trace.NativeUDPIngress || !trace.ApolloRecovered || !trace.ProductionQueue ||
|
||||||
!trace.ProductionMediaLoop || !trace.ProductionPacer || !trace.VerseQUIC ||
|
!trace.ProductionMediaLoop || !trace.ProductionPacer || !trace.VerseQUIC ||
|
||||||
!trace.PublicClientDecode || !trace.PayloadPreserved {
|
!trace.PublicClientDecode || !trace.PayloadPreserved {
|
||||||
return qualificationProcessingSummary{}, errors.New("qualification bypassed the production provider-to-client path")
|
return qualificationProcessingSummary{}, fmt.Errorf("qualification bypassed the production provider-to-client path: %#v", trace)
|
||||||
}
|
}
|
||||||
samples = append(samples, sample)
|
samples = append(samples, sample)
|
||||||
if _, writeErr := fmt.Fprintf(buffered, "%d,%d\n", time.Since(started).Nanoseconds(), sample.Nanoseconds()); writeErr != nil {
|
if _, writeErr := fmt.Fprintf(buffered, "%d,%d\n", time.Since(started).Nanoseconds(), sample.Nanoseconds()); writeErr != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user