From 885002e6c2d2a29b58f0af60cd3e9e392a108632 Mon Sep 17 00:00:00 2001 From: David Colburn Date: Thu, 27 Jun 2024 20:25:49 -0700 Subject: [PATCH] Fix pipeline frozen on track disconnection (#713) * fix pipeline frozen due to track disconnection * update go sdk * better errors for x and pulse --- .github/workflows/test-integration.yaml | 2 +- go.mod | 48 ++++---- go.sum | 110 +++++++++-------- magefile.go | 5 +- pkg/errors/errors.go | 24 ++-- pkg/pipeline/source/sdk/appwriter.go | 84 +++++++------ pkg/pipeline/source/web.go | 6 +- test/edge.go | 152 ++++++++++++++++++++++++ test/flags.go | 70 +++++++++++ test/integration.go | 69 ++++++----- test/participant.go | 53 +-------- test/room_composite.go | 81 ++++--------- test/runner.go | 82 +++++-------- test/track.go | 6 +- test/track_composite.go | 16 +-- test/web.go | 10 +- 16 files changed, 475 insertions(+), 343 deletions(-) create mode 100644 test/edge.go create mode 100644 test/flags.go diff --git a/.github/workflows/test-integration.yaml b/.github/workflows/test-integration.yaml index 1fe89858..139cfb58 100644 --- a/.github/workflows/test-integration.yaml +++ b/.github/workflows/test-integration.yaml @@ -93,7 +93,7 @@ jobs: needs: build strategy: matrix: - integration_type: [room, web, participant, track_composite, track] + integration_type: [room, web, participant, track_composite, track, edge] runs-on: buildjet-8vcpu-ubuntu-2204 steps: - uses: shogo82148/actions-setup-redis@v1 diff --git a/go.mod b/go.mod index 3c3e4fc4..f6b1a3a1 100644 --- a/go.mod +++ b/go.mod @@ -12,16 +12,16 @@ require ( github.com/frostbyte73/core v0.0.10 github.com/go-gst/go-glib v1.0.1 github.com/go-gst/go-gst v1.0.0 - github.com/go-logr/logr v1.4.1 + github.com/go-logr/logr v1.4.2 github.com/googleapis/gax-go/v2 v2.12.4 - github.com/gorilla/websocket v1.5.1 + github.com/gorilla/websocket v1.5.2 github.com/livekit/livekit-server v1.6.0 github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1 - github.com/livekit/protocol v1.17.1-0.20240612003900-1dd95af54240 + github.com/livekit/protocol v1.19.0 github.com/livekit/psrpc v0.5.3-0.20240526192918-fbdaf10e6aa5 - github.com/livekit/server-sdk-go/v2 v2.1.2-0.20240425022832-17b2be53a0d7 + github.com/livekit/server-sdk-go/v2 v2.2.1-0.20240628022514-ad17d3f0adad github.com/pion/rtp v1.8.6 - github.com/pion/webrtc/v3 v3.2.38 + github.com/pion/webrtc/v3 v3.2.43 github.com/prometheus/client_golang v1.19.0 github.com/prometheus/client_model v0.6.1 github.com/prometheus/common v0.53.0 @@ -29,11 +29,11 @@ require ( github.com/urfave/cli/v2 v2.27.1 go.uber.org/atomic v1.11.0 go.uber.org/zap v1.27.0 - golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f + golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 golang.org/x/oauth2 v0.21.0 google.golang.org/api v0.183.0 google.golang.org/grpc v1.64.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 gopkg.in/yaml.v3 v3.0.1 ) @@ -47,7 +47,7 @@ require ( github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bep/debounce v1.2.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chromedp/sysutil v1.0.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect @@ -71,22 +71,22 @@ require ( github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/jxskiss/base62 v1.1.0 // indirect - github.com/klauspost/compress v1.17.7 // indirect - github.com/klauspost/cpuid/v2 v2.2.6 // indirect + github.com/klauspost/compress v1.17.9 // indirect + github.com/klauspost/cpuid/v2 v2.2.7 // indirect github.com/lithammer/shortuuid/v4 v4.0.0 // indirect - github.com/livekit/mediatransportutil v0.0.0-20240406063423-a67d961689df // indirect + github.com/livekit/mediatransportutil v0.0.0-20240613015318-84b69facfb75 // indirect github.com/mackerelio/go-osstat v0.2.4 // indirect github.com/magefile/mage v1.15.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-ieproxy v0.0.1 // indirect github.com/mattn/go-pointer v0.0.1 // indirect - github.com/nats-io/nats.go v1.34.0 // indirect + github.com/nats-io/nats.go v1.36.0 // indirect github.com/nats-io/nkeys v0.4.7 // indirect github.com/nats-io/nuid v1.0.1 // indirect - github.com/pion/datachannel v1.5.5 // indirect - github.com/pion/dtls/v2 v2.2.10 // indirect - github.com/pion/ice/v2 v2.3.15 // indirect - github.com/pion/interceptor v0.1.27 // indirect + github.com/pion/datachannel v1.5.6 // indirect + github.com/pion/dtls/v2 v2.2.11 // indirect + github.com/pion/ice/v2 v2.3.24 // indirect + github.com/pion/interceptor v0.1.29 // indirect github.com/pion/logging v0.2.2 // indirect github.com/pion/mdns v0.0.12 // indirect github.com/pion/randutil v0.1.0 // indirect @@ -95,13 +95,13 @@ require ( github.com/pion/sdp/v3 v3.0.9 // indirect github.com/pion/srtp/v2 v2.0.18 // indirect github.com/pion/stun v0.6.1 // indirect - github.com/pion/transport/v2 v2.2.4 // indirect - github.com/pion/turn/v2 v2.1.5 // indirect + github.com/pion/transport/v2 v2.2.5 // indirect + github.com/pion/turn/v2 v2.1.6 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/puzpuzpuz/xsync/v3 v3.1.0 // indirect - github.com/redis/go-redis/v9 v9.5.1 // indirect + github.com/redis/go-redis/v9 v9.5.3 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/twitchtv/twirp v8.1.3+incompatible // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect @@ -114,13 +114,13 @@ require ( go.opentelemetry.io/otel/trace v1.24.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap/exp v0.2.0 // indirect - golang.org/x/crypto v0.23.0 // indirect - golang.org/x/net v0.25.0 // indirect + golang.org/x/crypto v0.24.0 // indirect + golang.org/x/net v0.26.0 // indirect golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/genproto v0.0.0-20240528184218-531527333157 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4 // indirect ) diff --git a/go.sum b/go.sum index 0efc8ce4..64b99d3e 100644 --- a/go.sum +++ b/go.sum @@ -44,8 +44,8 @@ github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdb github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chromedp/cdproto v0.0.0-20240202021202-6d0b6a386732/go.mod h1:GKljq0VrfU4D5yc+2qA6OVr8pmO/MBbPEWqWQ/oqGEs= github.com/chromedp/cdproto v0.0.0-20240421230201-ab917191657d h1:x9d0XwRV3aWw1gAZtv0LrI39U+Efjp0mtyXRyikGb9Y= github.com/chromedp/cdproto v0.0.0-20240421230201-ab917191657d/go.mod h1:GKljq0VrfU4D5yc+2qA6OVr8pmO/MBbPEWqWQ/oqGEs= @@ -89,8 +89,8 @@ github.com/go-gst/go-gst v1.0.0/go.mod h1:sQMWMnR98s2B4w52e4IXyGvz75rXV8CZ1bejdP github.com/go-jose/go-jose/v3 v3.0.3 h1:fFKWeig/irsp7XD2zBxvnmA/XaRWp5V3CBsZXJF7G7k= github.com/go-jose/go-jose/v3 v3.0.3/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQrVfLAMboGkQ= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= @@ -138,8 +138,8 @@ github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfF github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.12.4 h1:9gWcmF85Wvq4ryPFvGFaOgPIs1AQX0d0bcbGw4Z96qg= github.com/googleapis/gax-go/v2 v2.12.4/go.mod h1:KYEYLorsnIGDi/rPC8b5TdlB9kbKoFubselGIoBMCwI= -github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= -github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= +github.com/gorilla/websocket v1.5.2 h1:qoW6V1GT3aZxybsbC6oLnailWnB+qTMVwMreOso9XUw= +github.com/gorilla/websocket v1.5.2/go.mod h1:0n9H61RBAcf5/38py2MCYbxzPIY9rOkpvvMT24Rqs30= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= @@ -148,10 +148,10 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jxskiss/base62 v1.1.0 h1:A5zbF8v8WXx2xixnAKD2w+abC+sIzYJX+nxmhA6HWFw= github.com/jxskiss/base62 v1.1.0/go.mod h1:HhWAlUXvxKThfOlZbcuFzsqwtF5TcqS9ru3y5GfjWAc= -github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= -github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= -github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= -github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= +github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -168,14 +168,14 @@ github.com/livekit/livekit-server v1.6.0 h1:GyswI3nkC7/tmIJacSUZY2xG6Dbe11K6RjWr github.com/livekit/livekit-server v1.6.0/go.mod h1:VwBD+Lh20wd8amnAmvsUBTmyVZwILKagsHfiaSkmyRE= github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1 h1:jm09419p0lqTkDaKb5iXdynYrzB84ErPPO4LbRASk58= github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1/go.mod h1:Rs3MhFwutWhGwmY1VQsygw28z5bWcnEYmS1OG9OxjOQ= -github.com/livekit/mediatransportutil v0.0.0-20240406063423-a67d961689df h1:DVhJRlF6/CtiyxJVy3QsbS9bf7GyUMuRZONMwZxIWpY= -github.com/livekit/mediatransportutil v0.0.0-20240406063423-a67d961689df/go.mod h1:jwKUCmObuiEDH0iiuJHaGMXwRs3RjrB4G6qqgkr/5oE= -github.com/livekit/protocol v1.17.1-0.20240612003900-1dd95af54240 h1:aaL3N0lSJZEbaAxTckNGZHTjowmMJYYYoSDVND+kH8g= -github.com/livekit/protocol v1.17.1-0.20240612003900-1dd95af54240/go.mod h1:cN8WmGQR+kWz1+UWcAQdFFUcbW76PnfZDdkLAbYIqd4= +github.com/livekit/mediatransportutil v0.0.0-20240613015318-84b69facfb75 h1:p60OjeixzXnhGFQL8wmdUwWPxijEDe9ZJFMosq+byec= +github.com/livekit/mediatransportutil v0.0.0-20240613015318-84b69facfb75/go.mod h1:jwKUCmObuiEDH0iiuJHaGMXwRs3RjrB4G6qqgkr/5oE= +github.com/livekit/protocol v1.19.0 h1:EPcFQAa6ymVknKn21NbSeFuUsHTA8r3DH+RmP72yRrU= +github.com/livekit/protocol v1.19.0/go.mod h1:cN8WmGQR+kWz1+UWcAQdFFUcbW76PnfZDdkLAbYIqd4= github.com/livekit/psrpc v0.5.3-0.20240526192918-fbdaf10e6aa5 h1:mTZyrjk5WEWMsvaYtJ42pG7DuxysKj21DKPINpGSIto= github.com/livekit/psrpc v0.5.3-0.20240526192918-fbdaf10e6aa5/go.mod h1:CQUBSPfYYAaevg1TNCc6/aYsa8DJH4jSRFdCeSZk5u0= -github.com/livekit/server-sdk-go/v2 v2.1.2-0.20240425022832-17b2be53a0d7 h1:iZJnxZ0ZHMbiiUKHR3mV2CBWR5quNWv1disk7H4Iw5A= -github.com/livekit/server-sdk-go/v2 v2.1.2-0.20240425022832-17b2be53a0d7/go.mod h1:kwoe9UD6QwSyFAlZGfpJOymgE794DwJJ/CNTHYCz8PY= +github.com/livekit/server-sdk-go/v2 v2.2.1-0.20240628022514-ad17d3f0adad h1:SfX8OBXfUx9WHGEIsJi+rpWMsPhgtlRlQpHk3bnEZrI= +github.com/livekit/server-sdk-go/v2 v2.2.1-0.20240628022514-ad17d3f0adad/go.mod h1:pzzIik/xBvglkUstdIQP8taCI7s08KGIgCnc824y3oI= github.com/mackerelio/go-osstat v0.2.4 h1:qxGbdPkFo65PXOb/F/nhDKpF2nGmGaCFDLXoZjJTtUs= github.com/mackerelio/go-osstat v0.2.4/go.mod h1:Zy+qzGdZs3A9cuIqmgbJvwbmLQH9dJvtio5ZjJTbdlQ= github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg= @@ -186,23 +186,23 @@ github.com/mattn/go-ieproxy v0.0.1 h1:qiyop7gCflfhwCzGyeT0gro3sF9AIg9HU98JORTkqf github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E= github.com/mattn/go-pointer v0.0.1 h1:n+XhsuGeVO6MEAp7xyEukFINEa+Quek5psIR/ylA6o0= github.com/mattn/go-pointer v0.0.1/go.mod h1:2zXcozF6qYGgmsG+SeTZz3oAbFLdD3OWqnUbNvJZAlc= -github.com/nats-io/nats.go v1.34.0 h1:fnxnPCNiwIG5w08rlMcEKTUw4AV/nKyGCOJE8TdhSPk= -github.com/nats-io/nats.go v1.34.0/go.mod h1:Ubdu4Nh9exXdSz0RVWRFBbRfrbSxOYd26oF0wkWclB8= +github.com/nats-io/nats.go v1.36.0 h1:suEUPuWzTSse/XhESwqLxXGuj8vGRuPRoG7MoRN/qyU= +github.com/nats-io/nats.go v1.36.0/go.mod h1:Ubdu4Nh9exXdSz0RVWRFBbRfrbSxOYd26oF0wkWclB8= github.com/nats-io/nkeys v0.4.7 h1:RwNJbbIdYCoClSDNY7QVKZlyb/wfT6ugvFCiKy6vDvI= github.com/nats-io/nkeys v0.4.7/go.mod h1:kqXRgRDPlGy7nGaEDMuYzmiJCIAAWDK0IMBtDmGD0nc= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde h1:x0TT0RDC7UhAVbbWWBzr41ElhJx5tXPWkIHA2HWPRuw= github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0= -github.com/pion/datachannel v1.5.5 h1:10ef4kwdjije+M9d7Xm9im2Y3O6A6ccQb0zcqZcJew8= -github.com/pion/datachannel v1.5.5/go.mod h1:iMz+lECmfdCMqFRhXhcA/219B0SQlbpoR2V118yimL0= +github.com/pion/datachannel v1.5.6 h1:1IxKJntfSlYkpUj8LlYRSWpYiTTC02nUrOE8T3DqGeg= +github.com/pion/datachannel v1.5.6/go.mod h1:1eKT6Q85pRnr2mHiWHxJwO50SfZRtWHTsNIVb/NfGW4= github.com/pion/dtls/v2 v2.2.7/go.mod h1:8WiMkebSHFD0T+dIU+UeBaoV7kDhOW5oDCzZ7WZ/F9s= -github.com/pion/dtls/v2 v2.2.10 h1:u2Axk+FyIR1VFTPurktB+1zoEPGIW3bmyj3LEFrXjAA= -github.com/pion/dtls/v2 v2.2.10/go.mod h1:d9SYc9fch0CqK90mRk1dC7AkzzpwJj6u2GU3u+9pqFE= -github.com/pion/ice/v2 v2.3.15 h1:oCGVqnd6OWmJr4I6eQwSWn8VJDF45wIXFTjV3tyyris= -github.com/pion/ice/v2 v2.3.15/go.mod h1:KXJJcZK7E8WzrBEYnV4UtqEZsGeWfHxsNqhVcVvgjxw= -github.com/pion/interceptor v0.1.27 h1:mZ01OiGiukwRxezmDGzYjjokCVlDOk4T6BfaL5qrtGo= -github.com/pion/interceptor v0.1.27/go.mod h1:/vVaqLwDjGv4GRbgmChIKZIT5EXFDijwmj4WmIYy9bI= +github.com/pion/dtls/v2 v2.2.11 h1:9U/dpCYl1ySttROPWJgqWKEylUdT0fXp/xst6JwY5Ks= +github.com/pion/dtls/v2 v2.2.11/go.mod h1:d9SYc9fch0CqK90mRk1dC7AkzzpwJj6u2GU3u+9pqFE= +github.com/pion/ice/v2 v2.3.24 h1:RYgzhH/u5lH0XO+ABatVKCtRd+4U1GEaCXSMjNr13tI= +github.com/pion/ice/v2 v2.3.24/go.mod h1:KXJJcZK7E8WzrBEYnV4UtqEZsGeWfHxsNqhVcVvgjxw= +github.com/pion/interceptor v0.1.29 h1:39fsnlP1U8gw2JzOFWdfCU82vHvhW9o0rZnZF56wF+M= +github.com/pion/interceptor v0.1.29/go.mod h1:ri+LGNjRUc5xUNtDEPzfdkmSqISixVTBF/z/Zms/6T4= github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY= github.com/pion/logging v0.2.2/go.mod h1:k0/tDVsRCX2Mb2ZEmTqNa7CWsQPc+YYCB7Q+5pahoms= github.com/pion/mdns v0.0.12 h1:CiMYlY+O0azojWDmxdNr7ADGrnZ+V6Ilfner+6mSVK8= @@ -213,10 +213,9 @@ github.com/pion/rtcp v1.2.12/go.mod h1:sn6qjxvnwyAkkPzPULIbVqSKI5Dv54Rv7VG0kNxh9 github.com/pion/rtcp v1.2.14 h1:KCkGV3vJ+4DAJmvP0vaQShsb0xkRfWkO540Gy102KyE= github.com/pion/rtcp v1.2.14/go.mod h1:sn6qjxvnwyAkkPzPULIbVqSKI5Dv54Rv7VG0kNxh9L4= github.com/pion/rtp v1.8.3/go.mod h1:pBGHaFt/yW7bf1jjWAoUjpSNoDnw98KTMg+jWWvziqU= -github.com/pion/rtp v1.8.4/go.mod h1:pBGHaFt/yW7bf1jjWAoUjpSNoDnw98KTMg+jWWvziqU= github.com/pion/rtp v1.8.6 h1:MTmn/b0aWWsAzux2AmP8WGllusBVw4NPYPVFFd7jUPw= github.com/pion/rtp v1.8.6/go.mod h1:pBGHaFt/yW7bf1jjWAoUjpSNoDnw98KTMg+jWWvziqU= -github.com/pion/sctp v1.8.5/go.mod h1:SUFFfDpViyKejTAdwD1d/HQsCu+V/40cCs2nZIvC3s0= +github.com/pion/sctp v1.8.13/go.mod h1:YKSgO/bO/6aOMP9LCie1DuD7m+GamiK2yIiPM6vH+GA= github.com/pion/sctp v1.8.16 h1:PKrMs+o9EMLRvFfXq59WFsC+V8mN1wnKzqrv+3D/gYY= github.com/pion/sctp v1.8.16/go.mod h1:P6PbDVA++OJMrVNg2AL3XtYHV4uD6dvfyOovCgMs0PE= github.com/pion/sdp/v3 v3.0.9 h1:pX++dCHoHUwq43kuwf3PyJfHlwIj4hXA7Vrifiq0IJY= @@ -225,21 +224,20 @@ github.com/pion/srtp/v2 v2.0.18 h1:vKpAXfawO9RtTRKZJbG4y0v1b11NZxQnxRl85kGuUlo= github.com/pion/srtp/v2 v2.0.18/go.mod h1:0KJQjA99A6/a0DOVTu1PhDSw0CXF2jTkqOoMg3ODqdA= github.com/pion/stun v0.6.1 h1:8lp6YejULeHBF8NmV8e2787BogQhduZugh5PdhDyyN4= github.com/pion/stun v0.6.1/go.mod h1:/hO7APkX4hZKu/D0f2lHzNyvdkTGtIy3NDmLR7kSz/8= -github.com/pion/transport v0.14.1 h1:XSM6olwW+o8J4SCmOBb/BpwZypkHeyM0PGFCxNQBr40= -github.com/pion/transport v0.14.1/go.mod h1:4tGmbk00NeYA3rUa9+n+dzCCoKkcy3YlYb99Jn2fNnI= github.com/pion/transport/v2 v2.2.1/go.mod h1:cXXWavvCnFF6McHTft3DWS9iic2Mftcz1Aq29pGcU5g= github.com/pion/transport/v2 v2.2.2/go.mod h1:OJg3ojoBJopjEeECq2yJdXH9YVrUJ1uQ++NjXLOUorc= github.com/pion/transport/v2 v2.2.3/go.mod h1:q2U/tf9FEfnSBGSW6w5Qp5PFWRLRj3NjLhCCgpRK4p0= -github.com/pion/transport/v2 v2.2.4 h1:41JJK6DZQYSeVLxILA2+F4ZkKb4Xd/tFJZRFZQ9QAlo= github.com/pion/transport/v2 v2.2.4/go.mod h1:q2U/tf9FEfnSBGSW6w5Qp5PFWRLRj3NjLhCCgpRK4p0= +github.com/pion/transport/v2 v2.2.5 h1:iyi25i/21gQck4hfRhomF6SktmUQjRsRW4WJdhfc3Kc= +github.com/pion/transport/v2 v2.2.5/go.mod h1:q2U/tf9FEfnSBGSW6w5Qp5PFWRLRj3NjLhCCgpRK4p0= github.com/pion/transport/v3 v3.0.1/go.mod h1:UY7kiITrlMv7/IKgd5eTUcaahZx5oUN3l9SzK5f5xE0= github.com/pion/transport/v3 v3.0.2 h1:r+40RJR25S9w3jbA6/5uEPTzcdn7ncyU44RWCbHkLg4= github.com/pion/transport/v3 v3.0.2/go.mod h1:nIToODoOlb5If2jF9y2Igfx3PFYWfuXi37m0IlWa/D0= github.com/pion/turn/v2 v2.1.3/go.mod h1:huEpByKKHix2/b9kmTAM3YoX6MKP+/D//0ClgUYR2fY= -github.com/pion/turn/v2 v2.1.5 h1:tTyy7TM3DCoX9IxTt/yHc/bThiRLyXK3T1YbNcgx9k4= -github.com/pion/turn/v2 v2.1.5/go.mod h1:huEpByKKHix2/b9kmTAM3YoX6MKP+/D//0ClgUYR2fY= -github.com/pion/webrtc/v3 v3.2.38 h1:oA52VJAJhOjSi1JpKjf0CM+cCiZ3b7jBxvsoOiajeDU= -github.com/pion/webrtc/v3 v3.2.38/go.mod h1:AQ8p56OLbm3MjhYovYdgPuyX6oc+JcKx/HFoCGFcYzA= +github.com/pion/turn/v2 v2.1.6 h1:Xr2niVsiPTB0FPtt+yAWKFUkU1eotQbGgpTIld4x1Gc= +github.com/pion/turn/v2 v2.1.6/go.mod h1:huEpByKKHix2/b9kmTAM3YoX6MKP+/D//0ClgUYR2fY= +github.com/pion/webrtc/v3 v3.2.43 h1:Z4GesLwy/1qPbD6jT1BmtgsYTsTWzqqmu5EQHDhIkEs= +github.com/pion/webrtc/v3 v3.2.43/go.mod h1:M1RAe3TNTD1tzyvqHrbVODfwdPGSXOUo/OgpoGGJqFY= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -255,8 +253,8 @@ github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/puzpuzpuz/xsync/v3 v3.1.0 h1:EewKT7/LNac5SLiEblJeUu8z5eERHrmRLnMQL2d7qX4= github.com/puzpuzpuz/xsync/v3 v3.1.0/go.mod h1:VjzYrABPabuM4KyBh1Ftq6u8nhwY5tBPKP9jpmh0nnA= -github.com/redis/go-redis/v9 v9.5.1 h1:H1X4D3yHPaYrkL5X06Wh6xNVM/pX0Ft4RV0vMGvLBh8= -github.com/redis/go-redis/v9 v9.5.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= +github.com/redis/go-redis/v9 v9.5.3 h1:fOAp1/uJG+ZtcITgZOfYFmTKPE7n4Vclj1wZFgRciUU= +github.com/redis/go-redis/v9 v9.5.3/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= @@ -318,11 +316,12 @@ golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIi golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= -golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= +golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f h1:99ci1mjWVBWwJiEKYY6jWa4d2nTQVIEhZIptnrVb1XY= -golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= +golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY= +golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -339,15 +338,16 @@ golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= @@ -368,8 +368,6 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -379,11 +377,11 @@ golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= @@ -391,19 +389,19 @@ golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -429,8 +427,8 @@ google.golang.org/genproto v0.0.0-20240528184218-531527333157 h1:u7WMYrIrVvs0TF5 google.golang.org/genproto v0.0.0-20240528184218-531527333157/go.mod h1:ubQlAQnzejB8uZzszhrTCU2Fyp6Vi7ZE5nn0c3W8+qQ= google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 h1:+rdxYoE3E5htTEWIe15GlN6IfvbURM//Jt0mmkmm6ZU= google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117/go.mod h1:OimBR/bc1wPO9iV4NC2bpyjy3VnAwZh5EBPQdtaE5oo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4 h1:Di6ANFilr+S60a4S61ZM00vLdw0IrQOSMS2/6mrnOU0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= @@ -447,8 +445,8 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/magefile.go b/magefile.go index 1a4ff913..b38c6adc 100644 --- a/magefile.go +++ b/magefile.go @@ -115,7 +115,10 @@ func Integration(configFile string) error { files, _ := os.ReadDir("test/output") for _, file := range files { if file.IsDir() { - _ = os.RemoveAll(path.Join("test/output", file.Name())) + d, _ := os.ReadDir(path.Join("test/output", file.Name())) + if len(d) == 0 { + _ = os.RemoveAll(path.Join("test/output", file.Name())) + } } } }() diff --git a/pkg/errors/errors.go b/pkg/errors/errors.go index 1d92aa41..a1158b0e 100644 --- a/pkg/errors/errors.go +++ b/pkg/errors/errors.go @@ -88,7 +88,11 @@ func ErrGstPipelineError(err error) error { return psrpc.NewError(psrpc.Internal, err) } -func ErrProcessStartFailed(err error) error { +func ErrProcessFailed(process string, err error) error { + return psrpc.NewErrorf(psrpc.Internal, "failed to launch %s: %v", process, err) +} + +func ErrChromeFailedToStart(err error) error { return psrpc.NewError(psrpc.Internal, err) } @@ -129,22 +133,20 @@ func ErrInvalidUrl(url string, reason string) error { return psrpc.NewErrorf(psrpc.InvalidArgument, "invalid url %s: %s", url, reason) } -func ErrStreamNotFound(url string) error { - return psrpc.NewErrorf(psrpc.NotFound, "stream %s not found", url) -} - -func ErrTrackNotFound(trackID string) error { - return psrpc.NewErrorf(psrpc.NotFound, "track %s not found", trackID) +func ErrUploadFailed(location string, err error) error { + return psrpc.NewErrorf(psrpc.InvalidArgument, "%s upload failed: %v", location, err) } func ErrParticipantNotFound(identity string) error { return psrpc.NewErrorf(psrpc.NotFound, "participant %s not found", identity) } -// This can have many reasons, some related to invalid parameters, other because of system failure. -// Do not provide an error code until we have code to analyze the error from the underlying upload library further. -func ErrUploadFailed(location string, err error) error { - return psrpc.NewErrorf(psrpc.InvalidArgument, "%s upload failed: %v", location, err) +func ErrStreamNotFound(url string) error { + return psrpc.NewErrorf(psrpc.NotFound, "stream %s not found", url) +} + +func ErrTrackNotFound(trackID string) error { + return psrpc.NewErrorf(psrpc.NotFound, "track %s not found", trackID) } func ErrCPUExhausted(usage float64) error { diff --git a/pkg/pipeline/source/sdk/appwriter.go b/pkg/pipeline/source/sdk/appwriter.go index 800a37ba..2165010d 100644 --- a/pkg/pipeline/source/sdk/appwriter.go +++ b/pkg/pipeline/source/sdk/appwriter.go @@ -106,11 +106,15 @@ func NewAppWriter( } if logFilename != "" { + logger.Infow("logging to file", "filename", logFilename) f, err := os.Create(logFilename) if err != nil { return nil, err } - _, _ = f.WriteString("pts,sn,ts\n") + _, err = f.WriteString("pts,received_sn,adjusted_sn,received_ts,adjusted_ts\n") + if err != nil { + return nil, err + } w.logFile = f } @@ -182,7 +186,10 @@ func (w *AppWriter) SetTrackMuted(muted bool) { } func (w *AppWriter) SetTrackDisconnected(disconnected bool) { - w.disconnected.Store(disconnected) + if w.disconnected.Swap(disconnected) == disconnected { + return + } + if disconnected { w.logger.Debugw("track disconnected", "timestamp", time.Since(w.startTime).Seconds()) if w.playing.IsBroken() { @@ -291,45 +298,33 @@ func (w *AppWriter) handleMuted() { } func (w *AppWriter) handleReadError(err error) { - if w.draining.IsBroken() { - w.endStream.Break() - return - } + var netErr net.Error - // continue on buffer too small error - if err.Error() == errBufferTooSmall { + switch { + case w.draining.IsBroken(): + w.endStream.Break() + case err.Error() == errBufferTooSmall: w.logger.Warnw("read error", err) - return - } - - // check if reconnecting - if w.disconnected.Load() { - _ = w.pushSamples() - w.state = stateReconnecting - return - } - - // check if muted - if w.muted.Load() { + case w.muted.Load(): _ = w.pushSamples() w.ticker = time.NewTicker(w.GetFrameDuration()) w.state = stateMuted - return - } - - // continue on timeout - var netErr net.Error - if errors.As(err, &netErr) && netErr.Timeout() { - return - } + case w.disconnected.Load(): + _ = w.pushSamples() + w.state = stateReconnecting + case errors.As(err, &netErr) && netErr.Timeout(): + w.SetTrackDisconnected(true) + _ = w.pushSamples() + w.state = stateReconnecting + default: + // log non-EOF errors + if !errors.Is(err, io.EOF) { + w.logger.Errorw("could not read packet", err) + } - // log non-EOF errors - if !errors.Is(err, io.EOF) { - w.logger.Errorw("could not read packet", err) + // end stream + w.endStream.Break() } - - // end stream - w.endStream.Break() } func (w *AppWriter) pushSamples() error { @@ -340,6 +335,9 @@ func (w *AppWriter) pushSamples() error { pkts := w.buffer.Pop(false) for _, pkt := range pkts { + sn := pkt.SequenceNumber + ts := pkt.Timestamp + w.translator.Translate(pkt) // get PTS @@ -351,7 +349,19 @@ func (w *AppWriter) pushSamples() error { return err } - if w.state == stateUnmuting || w.state == stateReconnecting { + if w.logFile != nil { + _, _ = w.logFile.WriteString(fmt.Sprintf("%s,%d,%d,%d,%d\n", + pts.String(), + sn, pkt.SequenceNumber, + ts, pkt.Timestamp, + )) + } + + if w.state == stateUnmuting { + w.callbacks.OnTrackUnmuted(w.track.ID(), pts) + w.state = statePlaying + } else if w.state == stateReconnecting { + w.SetTrackDisconnected(false) w.callbacks.OnTrackUnmuted(w.track.ID(), pts) w.state = statePlaying } @@ -377,9 +387,5 @@ func (w *AppWriter) pushPacket(pkt *rtp.Packet, pts time.Duration) error { w.logger.Infow("unexpected flow return", "flow", flow) } - if w.logFile != nil { - _, _ = w.logFile.WriteString(fmt.Sprintf("%s,%d,%d\n", pts.String(), pkt.SequenceNumber, pkt.Timestamp)) - } - return nil } diff --git a/pkg/pipeline/source/web.go b/pkg/pipeline/source/web.go index c7106871..239abb3e 100644 --- a/pkg/pipeline/source/web.go +++ b/pkg/pipeline/source/web.go @@ -155,7 +155,7 @@ func (s *WebSource) createPulseSink(ctx context.Context, p *config.PipelineConfi cmd.Stderr = &infoLogger{cmd: "pactl"} err := cmd.Run() if err != nil { - return errors.ErrProcessStartFailed(err) + return errors.ErrProcessFailed("pulse", err) } s.pulseSink = strings.TrimRight(b.String(), "\n") @@ -172,7 +172,7 @@ func (s *WebSource) launchXvfb(ctx context.Context, p *config.PipelineConfig) er xvfb := exec.Command("Xvfb", p.Display, "-screen", "0", dims, "-ac", "-nolisten", "tcp", "-nolisten", "unix") xvfb.Stderr = &infoLogger{cmd: "xvfb"} if err := xvfb.Start(); err != nil { - return errors.ErrProcessStartFailed(err) + return errors.ErrProcessFailed("xvfb", err) } s.xvfb = xvfb @@ -320,7 +320,7 @@ func (s *WebSource) launchChrome(ctx context.Context, p *config.PipelineConfig, ) if err != nil { if strings.HasPrefix(err.Error(), chromeFailedToStart) { - return errors.ErrProcessStartFailed(err) + return errors.ErrChromeFailedToStart(err) } errString = err.Error() } diff --git a/test/edge.go b/test/edge.go new file mode 100644 index 00000000..d808a880 --- /dev/null +++ b/test/edge.go @@ -0,0 +1,152 @@ +// Copyright 2023 LiveKit, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package test + +import ( + "context" + "path" + "testing" + "time" + + "github.com/stretchr/testify/require" + + "github.com/livekit/egress/pkg/types" + "github.com/livekit/protocol/livekit" + "github.com/livekit/protocol/rpc" + "github.com/livekit/protocol/utils" + lksdk "github.com/livekit/server-sdk-go/v2" +) + +func (r *Runner) testEdgeCases(t *testing.T) { + if !r.should(runEdge) { + return + } + + // ParticipantComposite where the participant does not publish a track + r.runParticipantTest(t, "6B/Edge/ParticipantNoPublish", &testCase{}, + func(t *testing.T, identity string) { + req := &rpc.StartEgressRequest{ + EgressId: utils.NewGuid(utils.EgressPrefix), + Request: &rpc.StartEgressRequest_Participant{ + Participant: &livekit.ParticipantEgressRequest{ + RoomName: r.room.Name(), + Identity: identity, + FileOutputs: []*livekit.EncodedFileOutput{{ + FileType: livekit.EncodedFileType_MP4, + Filepath: "there won't be a file", + }}, + }, + }, + } + + info := r.sendRequest(t, req) + time.Sleep(time.Second * 15) + r.room.Disconnect() + time.Sleep(time.Second * 30) + info = r.getUpdate(t, info.EgressId) + require.Equal(t, livekit.EgressStatus_EGRESS_ABORTED.String(), info.Status.String()) + + // reconnect the publisher to the room + room, err := lksdk.ConnectToRoom(r.WsUrl, lksdk.ConnectInfo{ + APIKey: r.ApiKey, + APISecret: r.ApiSecret, + RoomName: r.RoomName, + ParticipantName: "egress-sample", + ParticipantIdentity: identity, + }, lksdk.NewRoomCallback()) + require.NoError(t, err) + r.room = room + }, + ) + + // Stream output with a bad rtmp url or stream key + r.runRoomTest(t, "6A/Edge/RtmpFailure", types.MimeTypeOpus, types.MimeTypeVP8, func(t *testing.T) { + req := &rpc.StartEgressRequest{ + EgressId: utils.NewGuid(utils.EgressPrefix), + Request: &rpc.StartEgressRequest_RoomComposite{ + RoomComposite: &livekit.RoomCompositeEgressRequest{ + RoomName: r.RoomName, + Layout: "speaker-light", + StreamOutputs: []*livekit.StreamOutput{{ + Protocol: livekit.StreamProtocol_RTMP, + Urls: []string{badStreamUrl1}, + }}, + }, + }, + } + + info, err := r.StartEgress(context.Background(), req) + require.NoError(t, err) + require.Empty(t, info.Error) + require.NotEmpty(t, info.EgressId) + require.Equal(t, r.RoomName, info.RoomName) + require.Equal(t, livekit.EgressStatus_EGRESS_STARTING, info.Status) + + // check update + time.Sleep(time.Second * 5) + info = r.getUpdate(t, info.EgressId) + if info.Status == livekit.EgressStatus_EGRESS_ACTIVE { + r.checkUpdate(t, info.EgressId, livekit.EgressStatus_EGRESS_FAILED) + } else { + require.Equal(t, livekit.EgressStatus_EGRESS_FAILED, info.Status) + } + }) + + // Track composite with data loss due to a disconnection + t.Run("6B/Edge/TrackDisconnection", func(t *testing.T) { + r.awaitIdle(t) + + test := &testCase{ + fileType: livekit.EncodedFileType_MP4, + audioCodec: types.MimeTypeOpus, + videoCodec: types.MimeTypeVP8, + filename: "track_disconnection_{time}.mp4", + } + + audioTrackID := r.publishSample(t, test.audioCodec, false) + videoTrackID := r.publishSampleWithDisconnection(t, test.videoCodec) + + var fileOutput *livekit.EncodedFileOutput + if r.AzureUpload != nil { + fileOutput = &livekit.EncodedFileOutput{ + FileType: test.fileType, + Filepath: path.Join(uploadPrefix, test.filename), + Output: &livekit.EncodedFileOutput_Azure{ + Azure: r.AzureUpload, + }, + } + } else { + fileOutput = &livekit.EncodedFileOutput{ + FileType: test.fileType, + Filepath: path.Join(r.FilePrefix, test.filename), + } + } + + req := &rpc.StartEgressRequest{ + EgressId: utils.NewGuid(utils.EgressPrefix), + Request: &rpc.StartEgressRequest_TrackComposite{ + TrackComposite: &livekit.TrackCompositeEgressRequest{ + RoomName: r.room.Name(), + AudioTrackId: audioTrackID, + VideoTrackId: videoTrackID, + FileOutputs: []*livekit.EncodedFileOutput{fileOutput}, + }, + }, + } + + test.expectVideoEncoding = true + r.runFileTest(t, req, test) + }) +} diff --git a/test/flags.go b/test/flags.go new file mode 100644 index 00000000..87cd40c8 --- /dev/null +++ b/test/flags.go @@ -0,0 +1,70 @@ +// Copyright 2023 LiveKit, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package test + +const ( + runRoom = 0b1 << 0 + runWeb = 0b1 << 1 + runParticipant = 0b1 << 2 + runTrackComposite = 0b1 << 3 + runTrack = 0b1 << 4 + runEdge = 0b1 << 5 + runAllRequests = 0b111111 + + runFile = 0b1 << 31 + runStream = 0b1 << 30 + runSegments = 0b1 << 29 + runImages = 0b1 << 28 + runMulti = 0b1 << 27 + runAllOutputs = 0b11111 << 27 +) + +func (r *Runner) updateFlagset() { + switch { + case r.RoomTestsOnly: + r.shouldRun |= runRoom + case r.ParticipantTestsOnly: + r.shouldRun |= runParticipant + case r.WebTestsOnly: + r.shouldRun |= runWeb + case r.TrackCompositeTestsOnly: + r.shouldRun |= runTrackComposite + case r.TrackTestsOnly: + r.shouldRun |= runTrack + case r.EdgeCasesOnly: + r.shouldRun |= runEdge + default: + r.shouldRun |= runAllRequests + } + + switch { + case r.FileTestsOnly: + r.shouldRun |= runFile + case r.StreamTestsOnly: + r.shouldRun |= runStream + case r.SegmentTestsOnly: + r.shouldRun |= runSegments + case r.ImageTestsOnly: + r.shouldRun |= runImages + case r.MultiTestsOnly: + r.shouldRun |= runMulti + default: + r.shouldRun |= runAllOutputs + } +} + +func (r *Runner) should(runFlag uint) bool { + return r.shouldRun&runFlag > 0 +} diff --git a/test/integration.go b/test/integration.go index f1b6100b..5505d40a 100644 --- a/test/integration.go +++ b/test/integration.go @@ -111,46 +111,22 @@ func (r *Runner) awaitIdle(t *testing.T) { t.Fatal("service not idle after 30s") } -func (r *Runner) publishSamplesToRoom(t *testing.T, audioCodec, videoCodec types.MimeType) (audioTrackID, videoTrackID string) { +func (r *Runner) publishSamples(t *testing.T, audioCodec, videoCodec types.MimeType) (audioTrackID, videoTrackID string) { withAudioMuting := false if videoCodec != "" { - videoTrackID = r.publishSampleToRoom(t, videoCodec, r.Muting) + videoTrackID = r.publishSample(t, videoCodec, r.Muting) } else { withAudioMuting = r.Muting } if audioCodec != "" { - audioTrackID = r.publishSampleToRoom(t, audioCodec, withAudioMuting) + audioTrackID = r.publishSample(t, audioCodec, withAudioMuting) } time.Sleep(time.Second) return } -func (r *Runner) publishSampleOffset(t *testing.T, codec types.MimeType, publishAt, unpublishAt time.Duration) { - if codec != "" { - go func() { - time.Sleep(publishAt) - done := make(chan struct{}) - pub := r.publish(t, codec, done) - if unpublishAt != 0 { - time.AfterFunc(unpublishAt-publishAt, func() { - select { - case <-done: - return - default: - _ = r.room.LocalParticipant.UnpublishTrack(pub.SID()) - } - }) - } else { - t.Cleanup(func() { - _ = r.room.LocalParticipant.UnpublishTrack(pub.SID()) - }) - } - }() - } -} - -func (r *Runner) publishSampleToRoom(t *testing.T, codec types.MimeType, withMuting bool) string { +func (r *Runner) publishSample(t *testing.T, codec types.MimeType, withMuting bool) string { done := make(chan struct{}) pub := r.publish(t, codec, done) trackID := pub.SID() @@ -179,6 +155,43 @@ func (r *Runner) publishSampleToRoom(t *testing.T, codec types.MimeType, withMut return trackID } +func (r *Runner) publishSampleOffset(t *testing.T, codec types.MimeType, publishAfter, unpublishAfter time.Duration) { + if codec == "" { + return + } + + time.AfterFunc(publishAfter, func() { + done := make(chan struct{}) + pub := r.publish(t, codec, done) + if unpublishAfter != 0 { + time.AfterFunc(unpublishAfter-publishAfter, func() { + select { + case <-done: + return + default: + _ = r.room.LocalParticipant.UnpublishTrack(pub.SID()) + } + }) + } else { + t.Cleanup(func() { + _ = r.room.LocalParticipant.UnpublishTrack(pub.SID()) + }) + } + }) +} + +func (r *Runner) publishSampleWithDisconnection(t *testing.T, codec types.MimeType) string { + done := make(chan struct{}) + pub := r.publish(t, codec, done) + trackID := pub.SID() + + time.AfterFunc(time.Second*10, func() { + pub.SimulateDisconnection(time.Second * 10) + }) + + return trackID +} + func (r *Runner) publish(t *testing.T, codec types.MimeType, done chan struct{}) *lksdk.LocalTrackPublication { filename := samples[codec] frameDuration := frameDurations[codec] diff --git a/test/participant.go b/test/participant.go index 1d60b762..e5c2fba2 100644 --- a/test/participant.go +++ b/test/participant.go @@ -21,17 +21,14 @@ import ( "testing" "time" - "github.com/stretchr/testify/require" - "github.com/livekit/egress/pkg/types" "github.com/livekit/protocol/livekit" "github.com/livekit/protocol/rpc" "github.com/livekit/protocol/utils" - lksdk "github.com/livekit/server-sdk-go/v2" ) func (r *Runner) testParticipant(t *testing.T) { - if !r.runParticipantTests() { + if !r.should(runParticipant) { return } @@ -61,7 +58,7 @@ func (r *Runner) runParticipantTest( } func (r *Runner) testParticipantFile(t *testing.T) { - if !r.runFileTests() { + if !r.should(runFile) { return } @@ -141,7 +138,7 @@ func (r *Runner) testParticipantFile(t *testing.T) { } func (r *Runner) testParticipantStream(t *testing.T) { - if !r.runStreamTests() { + if !r.should(runStream) { return } @@ -172,7 +169,7 @@ func (r *Runner) testParticipantStream(t *testing.T) { } func (r *Runner) testParticipantSegments(t *testing.T) { - if !r.runSegmentTests() { + if !r.should(runSegments) { return } @@ -247,7 +244,7 @@ func (r *Runner) testParticipantSegments(t *testing.T) { } func (r *Runner) testParticipantMulti(t *testing.T) { - if !r.runMultiTests() { + if !r.should(runMulti) { return } @@ -280,44 +277,4 @@ func (r *Runner) testParticipantMulti(t *testing.T) { r.runMultipleTest(t, req, true, true, false, false, livekit.SegmentedFileSuffix_INDEX) }, ) - - if r.Short { - return - } - - r.runParticipantTest(t, "3E/Participant/NoPublish", &testCase{}, - func(t *testing.T, identity string) { - req := &rpc.StartEgressRequest{ - EgressId: utils.NewGuid(utils.EgressPrefix), - Request: &rpc.StartEgressRequest_Participant{ - Participant: &livekit.ParticipantEgressRequest{ - RoomName: r.room.Name(), - Identity: identity, - FileOutputs: []*livekit.EncodedFileOutput{{ - FileType: livekit.EncodedFileType_MP4, - Filepath: "there won't be a file", - }}, - }, - }, - } - - info := r.sendRequest(t, req) - time.Sleep(time.Second * 15) - r.room.Disconnect() - time.Sleep(time.Second * 30) - info = r.getUpdate(t, info.EgressId) - require.Equal(t, livekit.EgressStatus_EGRESS_ABORTED.String(), info.Status.String()) - - // reconnect the publisher to the room - room, err := lksdk.ConnectToRoom(r.WsUrl, lksdk.ConnectInfo{ - APIKey: r.ApiKey, - APISecret: r.ApiSecret, - RoomName: r.RoomName, - ParticipantName: "egress-sample", - ParticipantIdentity: identity, - }, lksdk.NewRoomCallback()) - require.NoError(t, err) - r.room = room - }, - ) } diff --git a/test/room_composite.go b/test/room_composite.go index 2507b726..8eed79c6 100644 --- a/test/room_composite.go +++ b/test/room_composite.go @@ -17,12 +17,8 @@ package test import ( - "context" "path" "testing" - "time" - - "github.com/stretchr/testify/require" "github.com/livekit/egress/pkg/types" "github.com/livekit/protocol/livekit" @@ -31,7 +27,7 @@ import ( ) func (r *Runner) testRoomComposite(t *testing.T) { - if !r.runRoomTests() { + if !r.should(runRoom) { return } @@ -46,13 +42,13 @@ func (r *Runner) testRoomComposite(t *testing.T) { func (r *Runner) runRoomTest(t *testing.T, name string, audioCodec, videoCodec types.MimeType, f func(t *testing.T)) { t.Run(name, func(t *testing.T) { r.awaitIdle(t) - r.publishSamplesToRoom(t, audioCodec, videoCodec) + r.publishSamples(t, audioCodec, videoCodec) f(t) }) } func (r *Runner) testRoomCompositeFile(t *testing.T) { - if !r.runFileTests() { + if !r.should(runFile) { return } @@ -134,68 +130,31 @@ func (r *Runner) testRoomCompositeFile(t *testing.T) { } func (r *Runner) testRoomCompositeStream(t *testing.T) { - if !r.runStreamTests() { + if !r.should(runStream) { return } - t.Run("1B/RoomComposite/Stream", func(t *testing.T) { - r.runRoomTest(t, "Rtmp", types.MimeTypeOpus, types.MimeTypeVP8, func(t *testing.T) { - req := &rpc.StartEgressRequest{ - EgressId: utils.NewGuid(utils.EgressPrefix), - Request: &rpc.StartEgressRequest_RoomComposite{ - RoomComposite: &livekit.RoomCompositeEgressRequest{ - RoomName: r.room.Name(), - Layout: "grid-light", - StreamOutputs: []*livekit.StreamOutput{{ - Protocol: livekit.StreamProtocol_RTMP, - Urls: []string{streamUrl1, badStreamUrl1}, - }}, - }, + r.runRoomTest(t, "1B/RoomComposite/Stream", types.MimeTypeOpus, types.MimeTypeVP8, func(t *testing.T) { + req := &rpc.StartEgressRequest{ + EgressId: utils.NewGuid(utils.EgressPrefix), + Request: &rpc.StartEgressRequest_RoomComposite{ + RoomComposite: &livekit.RoomCompositeEgressRequest{ + RoomName: r.room.Name(), + Layout: "grid-light", + StreamOutputs: []*livekit.StreamOutput{{ + Protocol: livekit.StreamProtocol_RTMP, + Urls: []string{streamUrl1, badStreamUrl1}, + }}, }, - } - - r.runStreamTest(t, req, &testCase{expectVideoEncoding: true}) - }) - if r.Short { - return + }, } - r.runRoomTest(t, "Rtmp-Failure", types.MimeTypeOpus, types.MimeTypeVP8, func(t *testing.T) { - req := &rpc.StartEgressRequest{ - EgressId: utils.NewGuid(utils.EgressPrefix), - Request: &rpc.StartEgressRequest_RoomComposite{ - RoomComposite: &livekit.RoomCompositeEgressRequest{ - RoomName: r.RoomName, - Layout: "speaker-light", - StreamOutputs: []*livekit.StreamOutput{{ - Protocol: livekit.StreamProtocol_RTMP, - Urls: []string{badStreamUrl1}, - }}, - }, - }, - } - - info, err := r.StartEgress(context.Background(), req) - require.NoError(t, err) - require.Empty(t, info.Error) - require.NotEmpty(t, info.EgressId) - require.Equal(t, r.RoomName, info.RoomName) - require.Equal(t, livekit.EgressStatus_EGRESS_STARTING, info.Status) - - // check update - time.Sleep(time.Second * 5) - info = r.getUpdate(t, info.EgressId) - if info.Status == livekit.EgressStatus_EGRESS_ACTIVE { - r.checkUpdate(t, info.EgressId, livekit.EgressStatus_EGRESS_FAILED) - } else { - require.Equal(t, livekit.EgressStatus_EGRESS_FAILED, info.Status) - } - }) + r.runStreamTest(t, req, &testCase{expectVideoEncoding: true}) }) } func (r *Runner) testRoomCompositeSegments(t *testing.T) { - if !r.runSegmentTests() { + if !r.should(runSegments) { return } @@ -270,7 +229,7 @@ func (r *Runner) testRoomCompositeSegments(t *testing.T) { } func (r *Runner) testRoomCompositeImages(t *testing.T) { - if !r.runImageTests() { + if !r.should(runImages) { return } @@ -315,7 +274,7 @@ func (r *Runner) testRoomCompositeImages(t *testing.T) { } func (r *Runner) testRoomCompositeMulti(t *testing.T) { - if !r.runMultiTests() { + if !r.should(runMulti) { return } diff --git a/test/runner.go b/test/runner.go index 091a4c77..b0e2097a 100644 --- a/test/runner.go +++ b/test/runner.go @@ -54,21 +54,27 @@ type Runner struct { AzureUpload *livekit.AzureBlobUpload `yaml:"-"` // testing config - FilePrefix string `yaml:"file_prefix"` - RoomName string `yaml:"room_name"` - RoomTestsOnly bool `yaml:"room_only"` - WebTestsOnly bool `yaml:"web_only"` - ParticipantTestsOnly bool `yaml:"participant_only"` - TrackCompositeTestsOnly bool `yaml:"track_composite_only"` - TrackTestsOnly bool `yaml:"track_only"` - FileTestsOnly bool `yaml:"file_only"` - StreamTestsOnly bool `yaml:"stream_only"` - SegmentTestsOnly bool `yaml:"segments_only"` - ImageTestsOnly bool `yaml:"images_only"` - MultiTestsOnly bool `yaml:"multi_only"` - Muting bool `yaml:"muting"` - Dotfiles bool `yaml:"dot_files"` - Short bool `yaml:"short"` + FilePrefix string `yaml:"file_prefix"` + RoomName string `yaml:"room_name"` + Muting bool `yaml:"muting"` + Dotfiles bool `yaml:"dot_files"` + Short bool `yaml:"short"` + + // flagset used to determine which tests to run + shouldRun uint `yaml:"-"` + + RoomTestsOnly bool `yaml:"room_only"` + WebTestsOnly bool `yaml:"web_only"` + ParticipantTestsOnly bool `yaml:"participant_only"` + TrackCompositeTestsOnly bool `yaml:"track_composite_only"` + TrackTestsOnly bool `yaml:"track_only"` + EdgeCasesOnly bool `yaml:"edge_cases_only"` + + FileTestsOnly bool `yaml:"file_only"` + StreamTestsOnly bool `yaml:"stream_only"` + SegmentTestsOnly bool `yaml:"segments_only"` + ImageTestsOnly bool `yaml:"images_only"` + MultiTestsOnly bool `yaml:"multi_only"` } type Server interface { @@ -112,6 +118,9 @@ func NewRunner(t *testing.T) *Runner { case "track": r.TrackTestsOnly = true r.RoomName = fmt.Sprintf("track-integration-%d", rand.Intn(100)) + case "edge": + r.EdgeCasesOnly = true + r.RoomName = fmt.Sprintf("edge-integration-%d", rand.Intn(100)) default: if r.RoomName == "" { r.RoomName = fmt.Sprintf("egress-integration-%d", rand.Intn(100)) @@ -154,6 +163,8 @@ func NewRunner(t *testing.T) *Runner { logger.Infow("no azure config supplied") } + r.updateFlagset() + return r } @@ -216,44 +227,5 @@ func (r *Runner) RunTests(t *testing.T) { r.testParticipant(t) r.testTrackComposite(t) r.testTrack(t) -} - -func (r *Runner) runRoomTests() bool { - return !r.ParticipantTestsOnly && !r.TrackCompositeTestsOnly && !r.TrackTestsOnly && !r.WebTestsOnly -} - -func (r *Runner) runWebTests() bool { - return !r.RoomTestsOnly && !r.ParticipantTestsOnly && !r.TrackCompositeTestsOnly && !r.TrackTestsOnly -} - -func (r *Runner) runParticipantTests() bool { - return !r.RoomTestsOnly && !r.TrackCompositeTestsOnly && !r.TrackTestsOnly && !r.WebTestsOnly -} - -func (r *Runner) runTrackCompositeTests() bool { - return !r.RoomTestsOnly && !r.ParticipantTestsOnly && !r.TrackTestsOnly && !r.WebTestsOnly -} - -func (r *Runner) runTrackTests() bool { - return !r.RoomTestsOnly && !r.ParticipantTestsOnly && !r.TrackCompositeTestsOnly && !r.WebTestsOnly -} - -func (r *Runner) runFileTests() bool { - return !r.StreamTestsOnly && !r.SegmentTestsOnly && !r.MultiTestsOnly && !r.ImageTestsOnly -} - -func (r *Runner) runStreamTests() bool { - return !r.FileTestsOnly && !r.SegmentTestsOnly && !r.MultiTestsOnly && !r.ImageTestsOnly -} - -func (r *Runner) runSegmentTests() bool { - return !r.FileTestsOnly && !r.StreamTestsOnly && !r.MultiTestsOnly && !r.ImageTestsOnly -} - -func (r *Runner) runImageTests() bool { - return !r.FileTestsOnly && !r.StreamTestsOnly && !r.SegmentTestsOnly && !r.MultiTestsOnly -} - -func (r *Runner) runMultiTests() bool { - return !r.FileTestsOnly && !r.StreamTestsOnly && !r.SegmentTestsOnly && !r.ImageTestsOnly + r.testEdgeCases(t) } diff --git a/test/track.go b/test/track.go index 4a082650..e22470d6 100644 --- a/test/track.go +++ b/test/track.go @@ -38,7 +38,7 @@ import ( ) func (r *Runner) testTrack(t *testing.T) { - if !r.runTrackTests() { + if !r.should(runTrack) { return } @@ -48,7 +48,7 @@ func (r *Runner) testTrack(t *testing.T) { } func (r *Runner) testTrackFile(t *testing.T) { - if !r.runFileTests() { + if !r.should(runFile) { return } @@ -116,7 +116,7 @@ func (r *Runner) testTrackFile(t *testing.T) { } func (r *Runner) testTrackStream(t *testing.T) { - if !r.runStreamTests() { + if !r.should(runStream) { return } diff --git a/test/track_composite.go b/test/track_composite.go index 1bc1ab09..51fc4dbf 100644 --- a/test/track_composite.go +++ b/test/track_composite.go @@ -27,7 +27,7 @@ import ( ) func (r *Runner) testTrackComposite(t *testing.T) { - if !r.runTrackCompositeTests() { + if !r.should(runTrackComposite) { return } @@ -45,13 +45,13 @@ func (r *Runner) runTrackTest( ) { t.Run(name, func(t *testing.T) { r.awaitIdle(t) - audioTrackID, videoTrackID := r.publishSamplesToRoom(t, audioCodec, videoCodec) + audioTrackID, videoTrackID := r.publishSamples(t, audioCodec, videoCodec) f(t, audioTrackID, videoTrackID) }) } func (r *Runner) testTrackCompositeFile(t *testing.T) { - if !r.runFileTests() { + if !r.should(runFile) { return } @@ -82,7 +82,7 @@ func (r *Runner) testTrackCompositeFile(t *testing.T) { } var fileOutput *livekit.EncodedFileOutput - if test.filenameSuffix == livekit.SegmentedFileSuffix_INDEX && r.AzureUpload != nil { + if r.AzureUpload != nil { fileOutput = &livekit.EncodedFileOutput{ FileType: test.fileType, Filepath: path.Join(uploadPrefix, test.filename), @@ -127,7 +127,7 @@ func (r *Runner) testTrackCompositeFile(t *testing.T) { } func (r *Runner) testTrackCompositeStream(t *testing.T) { - if !r.runStreamTests() { + if !r.should(runStream) { return } @@ -153,7 +153,7 @@ func (r *Runner) testTrackCompositeStream(t *testing.T) { } func (r *Runner) testTrackCompositeSegments(t *testing.T) { - if !r.runSegmentTests() { + if !r.should(runSegments) { return } @@ -243,7 +243,7 @@ func (r *Runner) testTrackCompositeSegments(t *testing.T) { } func (r *Runner) testTrackCompositeImages(t *testing.T) { - if !r.runImageTests() { + if !r.should(runImages) { return } @@ -302,7 +302,7 @@ func (r *Runner) testTrackCompositeImages(t *testing.T) { } func (r *Runner) testTrackCompositeMulti(t *testing.T) { - if !r.runMultiTests() { + if !r.should(runMulti) { return } diff --git a/test/web.go b/test/web.go index ae154990..aafa6ecf 100644 --- a/test/web.go +++ b/test/web.go @@ -26,7 +26,7 @@ import ( ) func (r *Runner) testWeb(t *testing.T) { - if !r.runWebTests() { + if !r.should(runWeb) { return } @@ -45,7 +45,7 @@ func (r *Runner) runWebTest(t *testing.T, name string, f func(t *testing.T)) { } func (r *Runner) testWebFile(t *testing.T) { - if !r.runFileTests() { + if !r.should(runFile) { return } @@ -82,7 +82,7 @@ func (r *Runner) testWebFile(t *testing.T) { } func (r *Runner) testWebStream(t *testing.T) { - if !r.runStreamTests() { + if !r.should(runStream) { return } @@ -105,7 +105,7 @@ func (r *Runner) testWebStream(t *testing.T) { } func (r *Runner) testWebSegments(t *testing.T) { - if !r.runSegmentTests() { + if !r.should(runSegments) { return } @@ -143,7 +143,7 @@ func (r *Runner) testWebSegments(t *testing.T) { } func (r *Runner) testWebMulti(t *testing.T) { - if !r.runMultiTests() { + if !r.should(runMulti) { return }