feat(gateway): relay complete encoded frames
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package gateway
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -17,6 +18,24 @@ func TestGatewaySlowReaderStillCleansUpWithinBound(t *testing.T) {
|
||||
harness.waitReleased(t)
|
||||
}
|
||||
|
||||
func TestGatewayDropsVideoPastQueueResidenceBound(t *testing.T) {
|
||||
harness := newGatewayTransportHarness(t)
|
||||
harness.drainInitialMedia(t)
|
||||
before := harness.server.Metrics().MediaDrops
|
||||
harness.session.video <- ProviderMedia{
|
||||
Payload: []byte("stale-complete-frame"), ReceivedAt: time.Now().Add(-time.Second),
|
||||
EnqueuedAt: time.Now().Add(-nativeApolloVideoQueueLatency - time.Millisecond),
|
||||
}
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 150*time.Millisecond)
|
||||
defer cancel()
|
||||
if frame, err := harness.client.ReceiveFrame(ctx); err == nil {
|
||||
t.Fatalf("expired provider frame crossed the public transport: %#v", frame)
|
||||
}
|
||||
if drops := harness.server.Metrics().MediaDrops - before; drops != 1 {
|
||||
t.Fatalf("expired queue drops = %d, want 1", drops)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGatewayMalformedUDPDoesNotAmplify(t *testing.T) {
|
||||
harness := newGatewayTransportHarness(t)
|
||||
connection, err := net.DialUDP("udp", nil, harness.server.Addr().(*net.UDPAddr))
|
||||
|
||||
Reference in New Issue
Block a user