Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix race condition in test #2784

Merged
merged 1 commit into from
Jun 16, 2024
Merged

Fix race condition in test #2784

merged 1 commit into from
Jun 16, 2024

Conversation

aler9
Copy link
Member

@aler9 aler9 commented Jun 10, 2024

In TestPeerConnection_Zero_PayloadType, WriteSample might be called after closePairNow, resulting in failure:

=== RUN   TestPeerConnection_Zero_PayloadType
goroutine profile: total 82
20 @ 0x4761ae 0x46ee57 0x4a99a5 0x4f7f71 0x4fa5fc 0x4fa5d0 0x753175 0x778325 0x776512 0x776891 0x9d7694 0x4af0c1
#       0x4a99a4        internal/poll.runtime_pollWait+0x84                     /usr/local/go/src/runtime/netpoll.go:345
#       0x4f7f70        internal/poll.(*pollDesc).wait+0xb0                     /usr/local/go/src/internal/poll/fd_poll_runtime.go:84
#       0x4fa5fb        internal/poll.(*pollDesc).waitRead+0x3fb                /usr/local/go/src/internal/poll/fd_poll_runtime.go:89
#       0x4fa5cf        internal/poll.(*FD).ReadFromInet6+0x3cf                 /usr/local/go/src/internal/poll/fd_unix.go:274
#       0x753174        net.(*netFD).readFromInet6+0x54                         /usr/local/go/src/net/fd_posix.go:72
#       0x778324        net.(*UDPConn).readFrom+0x104                           /usr/local/go/src/net/udpsock_posix.go:59
#       0x776511        net.(*UDPConn).readFromUDP+0x91                         /usr/local/go/src/net/udpsock.go:149
#       0x776890        net.(*UDPConn).ReadFrom+0x90                            /usr/local/go/src/net/udpsock.go:158
#       0x9d7693        github.com/pion/ice/v3.(*candidateBase).recvLoop+0x233  /home/ale/go/pkg/mod/github.com/pion/ice/[email protected]/candidate_base.go:228

10 @ 0x4761ae 0x46ee57 0x4a99a5 0x4f7f71 0x4fa05c 0x4fa030 0x752fb5 0x7784ab 0x776512 0x776891 0x9d7694 0x4af0c1
#       0x4a99a4        internal/poll.runtime_pollWait+0x84                     /usr/local/go/src/runtime/netpoll.go:345
#       0x4f7f70        internal/poll.(*pollDesc).wait+0xb0                     /usr/local/go/src/internal/poll/fd_poll_runtime.go:84
#       0x4fa05b        internal/poll.(*pollDesc).waitRead+0x3fb                /usr/local/go/src/internal/poll/fd_poll_runtime.go:89
#       0x4fa02f        internal/poll.(*FD).ReadFromInet4+0x3cf                 /usr/local/go/src/internal/poll/fd_unix.go:247
#       0x752fb4        net.(*netFD).readFromInet4+0x54                         /usr/local/go/src/net/fd_posix.go:66
#       0x7784aa        net.(*UDPConn).readFrom+0x28a                           /usr/local/go/src/net/udpsock_posix.go:52
#       0x776511        net.(*UDPConn).readFromUDP+0x91                         /usr/local/go/src/net/udpsock.go:149
#       0x776890        net.(*UDPConn).ReadFrom+0x90                            /usr/local/go/src/net/udpsock.go:158
#       0x9d7693        github.com/pion/ice/v3.(*candidateBase).recvLoop+0x233  /home/ale/go/pkg/mod/github.com/pion/ice/[email protected]/candidate_base.go:228

4 @ 0x4761ae 0x4893c5 0x956858 0xa0979c 0x95b322 0x4af0c1
#       0x956857        github.com/pion/transport/v3/packetio.(*Buffer).Read+0x317      /home/ale/go/pkg/mod/github.com/pion/transport/[email protected]/packetio/buffer.go:267
#       0xa0979b        github.com/pion/webrtc/v4/internal/mux.(*Endpoint).Read+0x5b    /home/ale/dev/webrtc/internal/mux/endpoint.go:44
#       0x95b321        github.com/pion/srtp/v3.(*session).start.func1+0x121            /home/ale/go/pkg/mod/github.com/pion/srtp/[email protected]/session.go:144

2 @ 0x4761ae 0x43f8cd 0x43f532 0x9914dd 0x4af0c1
#       0x9914dc        github.com/pion/mdns/v2.(*Conn).start+0x7dc     /home/ale/go/pkg/mod/github.com/pion/mdns/[email protected]/conn.go:1169

2 @ 0x4761ae 0x43f8cd 0x43f552 0x934cee 0x934cfc 0xab2999 0x4af0c1
#       0x934ced        github.com/pion/sctp.(*Association).AcceptStream+0x6d                   /home/ale/go/pkg/mod/github.com/pion/[email protected]/association.go:1512
#       0x934cfb        github.com/pion/datachannel.Accept+0x7b                                 /home/ale/go/pkg/mod/github.com/pion/[email protected]/datachannel.go:131
#       0xab2998        github.com/pion/webrtc/v4.(*SCTPTransport).acceptDataChannels+0x3b8     /home/ale/dev/webrtc/sctptransport.go:181

2 @ 0x4761ae 0x43f8cd 0x43f552 0x95c431 0xa97565 0x4af0c1
#       0x95c430        github.com/pion/srtp/v3.(*SessionSRTCP).AcceptStream+0x50                       /home/ale/go/pkg/mod/github.com/pion/srtp/[email protected]/session_srtcp.go:96
#       0xa97564        github.com/pion/webrtc/v4.(*PeerConnection).undeclaredRTCPMediaProcessor+0x164  /home/ale/dev/webrtc/peerconnection.go:1700

2 @ 0x4761ae 0x43f8cd 0x43f552 0x95df91 0xa96bc5 0x4af0c1
#       0x95df90        github.com/pion/srtp/v3.(*SessionSRTP).AcceptStream+0x50                        /home/ale/go/pkg/mod/github.com/pion/srtp/[email protected]/session_srtp.go:98
#       0xa96bc4        github.com/pion/webrtc/v4.(*PeerConnection).undeclaredRTPMediaProcessor+0xe4    /home/ale/dev/webrtc/peerconnection.go:1656

2 @ 0x4761ae 0x46ee57 0x4a99a5 0x4f7f71 0x4fccf0 0x4fccca 0x76cfb9 0x87178a 0x878a6a 0x878a3f 0x98beaa 0x98cca2 0x9917e9 0x4af0c1
#       0x4a99a4        internal/poll.runtime_pollWait+0x84                     /usr/local/go/src/runtime/netpoll.go:345
#       0x4f7f70        internal/poll.(*pollDesc).wait+0xb0                     /usr/local/go/src/internal/poll/fd_poll_runtime.go:84
#       0x4fccef        internal/poll.(*pollDesc).waitRead+0x26f                /usr/local/go/src/internal/poll/fd_poll_runtime.go:89
#       0x4fccc9        internal/poll.(*FD).RawRead+0x249                       /usr/local/go/src/internal/poll/fd_unix.go:708
#       0x76cfb8        net.(*rawConn).Read+0x78                                /usr/local/go/src/net/rawconn.go:44
#       0x871789        golang.org/x/net/internal/socket.(*Conn).recvMsg+0x389  /home/ale/go/pkg/mod/golang.org/x/[email protected]/internal/socket/rawconn_msg.go:27
#       0x878a69        golang.org/x/net/internal/socket.(*Conn).RecvMsg+0x789  /home/ale/go/pkg/mod/golang.org/x/[email protected]/internal/socket/socket.go:247
#       0x878a3e        golang.org/x/net/ipv4.(*payloadHandler).ReadFrom+0x75e  /home/ale/go/pkg/mod/golang.org/x/[email protected]/ipv4/payload_cmsg.go:31
#       0x98bea9        github.com/pion/mdns/v2.ipPacketConn4.ReadFrom+0x89     /home/ale/go/pkg/mod/github.com/pion/mdns/[email protected]/conn.go:801
#       0x98cca1        github.com/pion/mdns/v2.(*Conn).readLoop+0xe1           /home/ale/go/pkg/mod/github.com/pion/mdns/[email protected]/conn.go:863
#       0x9917e8        github.com/pion/mdns/v2.(*Conn).start.func4+0x108       /home/ale/go/pkg/mod/github.com/pion/mdns/[email protected]/conn.go:1151

2 @ 0x4761ae 0x46ee57 0x4a99a5 0x4f7f71 0x4fccf0 0x4fccca 0x76cfb9 0x87178a 0x878a6a 0x878a3f 0x98beaa 0x98cca2 0x991b29 0x4af0c1
#       0x4a99a4        internal/poll.runtime_pollWait+0x84                     /usr/local/go/src/runtime/netpoll.go:345
#       0x4f7f70        internal/poll.(*pollDesc).wait+0xb0                     /usr/local/go/src/internal/poll/fd_poll_runtime.go:84
#       0x4fccef        internal/poll.(*pollDesc).waitRead+0x26f                /usr/local/go/src/internal/poll/fd_poll_runtime.go:89
#       0x4fccc9        internal/poll.(*FD).RawRead+0x249                       /usr/local/go/src/internal/poll/fd_unix.go:708
#       0x76cfb8        net.(*rawConn).Read+0x78                                /usr/local/go/src/net/rawconn.go:44
#       0x871789        golang.org/x/net/internal/socket.(*Conn).recvMsg+0x389  /home/ale/go/pkg/mod/golang.org/x/[email protected]/internal/socket/rawconn_msg.go:27
#       0x878a69        golang.org/x/net/internal/socket.(*Conn).RecvMsg+0x789  /home/ale/go/pkg/mod/golang.org/x/[email protected]/internal/socket/socket.go:247
#       0x878a3e        golang.org/x/net/ipv4.(*payloadHandler).ReadFrom+0x75e  /home/ale/go/pkg/mod/golang.org/x/[email protected]/ipv4/payload_cmsg.go:31
#       0x98bea9        github.com/pion/mdns/v2.ipPacketConn4.ReadFrom+0x89     /home/ale/go/pkg/mod/github.com/pion/mdns/[email protected]/conn.go:801
#       0x98cca1        github.com/pion/mdns/v2.(*Conn).readLoop+0xe1           /home/ale/go/pkg/mod/github.com/pion/mdns/[email protected]/conn.go:863
#       0x991b28        github.com/pion/mdns/v2.(*Conn).start.func2+0x108       /home/ale/go/pkg/mod/github.com/pion/mdns/[email protected]/conn.go:1131

2 @ 0x4761ae 0x46ee57 0x4a99a5 0x4f7f71 0x4fccf0 0x4fccca 0x76cfb9 0x87178a 0x8804a5 0x88047d 0x98c56a 0x98cca2 0x99164c 0x4af0c1
#       0x4a99a4        internal/poll.runtime_pollWait+0x84                     /usr/local/go/src/runtime/netpoll.go:345
#       0x4f7f70        internal/poll.(*pollDesc).wait+0xb0                     /usr/local/go/src/internal/poll/fd_poll_runtime.go:84
#       0x4fccef        internal/poll.(*pollDesc).waitRead+0x26f                /usr/local/go/src/internal/poll/fd_poll_runtime.go:89
#       0x4fccc9        internal/poll.(*FD).RawRead+0x249                       /usr/local/go/src/internal/poll/fd_unix.go:708
#       0x76cfb8        net.(*rawConn).Read+0x78                                /usr/local/go/src/net/rawconn.go:44
#       0x871789        golang.org/x/net/internal/socket.(*Conn).recvMsg+0x389  /home/ale/go/pkg/mod/golang.org/x/[email protected]/internal/socket/rawconn_msg.go:27
#       0x8804a4        golang.org/x/net/internal/socket.(*Conn).RecvMsg+0x544  /home/ale/go/pkg/mod/golang.org/x/[email protected]/internal/socket/socket.go:247
#       0x88047c        golang.org/x/net/ipv6.(*payloadHandler).ReadFrom+0x51c  /home/ale/go/pkg/mod/golang.org/x/[email protected]/ipv6/payload_cmsg.go:31
#       0x98c569        github.com/pion/mdns/v2.ipPacketConn6.ReadFrom+0x89     /home/ale/go/pkg/mod/github.com/pion/mdns/[email protected]/conn.go:833
#       0x98cca1        github.com/pion/mdns/v2.(*Conn).readLoop+0xe1           /home/ale/go/pkg/mod/github.com/pion/mdns/[email protected]/conn.go:863
#       0x99164b        github.com/pion/mdns/v2.(*Conn).start.func5+0x10b       /home/ale/go/pkg/mod/github.com/pion/mdns/[email protected]/conn.go:1161

2 @ 0x4761ae 0x46ee57 0x4a99a5 0x4f7f71 0x4fccf0 0x4fccca 0x76cfb9 0x87178a 0x8804a5 0x88047d 0x98c56a 0x98cca2 0x991989 0x4af0c1
#       0x4a99a4        internal/poll.runtime_pollWait+0x84                     /usr/local/go/src/runtime/netpoll.go:345
#       0x4f7f70        internal/poll.(*pollDesc).wait+0xb0                     /usr/local/go/src/internal/poll/fd_poll_runtime.go:84
#       0x4fccef        internal/poll.(*pollDesc).waitRead+0x26f                /usr/local/go/src/internal/poll/fd_poll_runtime.go:89
#       0x4fccc9        internal/poll.(*FD).RawRead+0x249                       /usr/local/go/src/internal/poll/fd_unix.go:708
#       0x76cfb8        net.(*rawConn).Read+0x78                                /usr/local/go/src/net/rawconn.go:44
#       0x871789        golang.org/x/net/internal/socket.(*Conn).recvMsg+0x389  /home/ale/go/pkg/mod/golang.org/x/[email protected]/internal/socket/rawconn_msg.go:27
#       0x8804a4        golang.org/x/net/internal/socket.(*Conn).RecvMsg+0x544  /home/ale/go/pkg/mod/golang.org/x/[email protected]/internal/socket/socket.go:247
#       0x88047c        golang.org/x/net/ipv6.(*payloadHandler).ReadFrom+0x51c  /home/ale/go/pkg/mod/golang.org/x/[email protected]/ipv6/payload_cmsg.go:31
#       0x98c569        github.com/pion/mdns/v2.ipPacketConn6.ReadFrom+0x89     /home/ale/go/pkg/mod/github.com/pion/mdns/[email protected]/conn.go:833
#       0x98cca1        github.com/pion/mdns/v2.(*Conn).readLoop+0xe1           /home/ale/go/pkg/mod/github.com/pion/mdns/[email protected]/conn.go:863
#       0x991988        github.com/pion/mdns/v2.(*Conn).start.func3+0x108       /home/ale/go/pkg/mod/github.com/pion/mdns/[email protected]/conn.go:1141

2 @ 0x4761ae 0x4893c5 0x584dbd 0x4af0c1
#       0x584dbc        context.(*cancelCtx).propagateCancel.func2+0xdc /usr/local/go/src/context/context.go:510

2 @ 0x4761ae 0x4893c5 0x862732 0x4af0c1
#       0x862731        github.com/pion/transport/v2/connctx.(*connCtx).ReadContext.func1+0x151 /home/ale/go/pkg/mod/github.com/pion/transport/[email protected]/connctx/connctx.go:83

2 @ 0x4761ae 0x4893c5 0x8c1913 0x8f33ad 0x4af0c1
#       0x8c1912        github.com/pion/dtls/v2.(*Conn).Read+0x212              /home/ale/go/pkg/mod/github.com/pion/dtls/[email protected]/conn.go:325
#       0x8f33ac        github.com/pion/sctp.(*Association).readLoop+0x22c      /home/ale/go/pkg/mod/github.com/pion/[email protected]/association.go:595

2 @ 0x4761ae 0x4893c5 0x8e9739 0x8e7d52 0x8c95d3 0x4af0c1
#       0x8e9738        github.com/pion/dtls/v2.(*handshakeFSM).finish+0x2d8    /home/ale/go/pkg/mod/github.com/pion/dtls/[email protected]/handshaker.go:322
#       0x8e7d51        github.com/pion/dtls/v2.(*handshakeFSM).Run+0x611       /home/ale/go/pkg/mod/github.com/pion/dtls/[email protected]/handshaker.go:189
#       0x8c95d2        github.com/pion/dtls/v2.(*Conn).handshake.func2+0x112   /home/ale/go/pkg/mod/github.com/pion/dtls/[email protected]/conn.go:872

2 @ 0x4761ae 0x4893c5 0x8f43d5 0x4af0c1
#       0x8f43d4        github.com/pion/sctp.(*Association).writeLoop+0x354     /home/ale/go/pkg/mod/github.com/pion/[email protected]/association.go:645

2 @ 0x4761ae 0x4893c5 0x956858 0xa004ee 0xa0a7cd 0x4af0c1
#       0x956857        github.com/pion/transport/v3/packetio.(*Buffer).Read+0x317      /home/ale/go/pkg/mod/github.com/pion/transport/[email protected]/packetio/buffer.go:267
#       0xa004ed        github.com/pion/ice/v3.(*Conn).Read+0x12d                       /home/ale/go/pkg/mod/github.com/pion/ice/[email protected]/transport.go:76
#       0xa0a7cc        github.com/pion/webrtc/v4/internal/mux.(*Mux).readLoop+0x18c    /home/ale/dev/webrtc/internal/mux/mux.go:110

2 @ 0x4761ae 0x4893c5 0x956858 0xa0979c 0x862348 0x8c4afb 0x8c8bb0 0x4af0c1
#       0x956857        github.com/pion/transport/v3/packetio.(*Buffer).Read+0x317              /home/ale/go/pkg/mod/github.com/pion/transport/[email protected]/packetio/buffer.go:267
#       0xa0979b        github.com/pion/webrtc/v4/internal/mux.(*Endpoint).Read+0x5b            /home/ale/dev/webrtc/internal/mux/endpoint.go:44
#       0x862347        github.com/pion/transport/v2/connctx.(*connCtx).ReadContext+0x3a7       /home/ale/go/pkg/mod/github.com/pion/transport/[email protected]/connctx/connctx.go:98
#       0x8c4afa        github.com/pion/dtls/v2.(*Conn).readAndBuffer+0x19a                     /home/ale/go/pkg/mod/github.com/pion/dtls/[email protected]/conn.go:604
#       0x8c8baf        github.com/pion/dtls/v2.(*Conn).handshake.func3+0x1af                   /home/ale/go/pkg/mod/github.com/pion/dtls/[email protected]/conn.go:891

2 @ 0x4761ae 0x4893c5 0x97870d 0x4af0c1
#       0x97870c        github.com/pion/ice/v3/internal/taskloop.(*Loop).runLoop+0x1cc  /home/ale/go/pkg/mod/github.com/pion/ice/[email protected]/internal/taskloop/taskloop.go:54

2 @ 0x4761ae 0x4893c5 0x9c8e65 0x4af0c1
#       0x9c8e64        github.com/pion/ice/v3.(*Agent).connectivityChecks+0x424        /home/ale/go/pkg/mod/github.com/pion/ice/[email protected]/agent.go:407

2 @ 0x4761ae 0x4893c5 0xa0ca05 0x4af0c1
#       0xa0ca04        github.com/pion/interceptor/pkg/nack.(*GeneratorInterceptor).loop+0x264 /home/ale/go/pkg/mod/github.com/pion/[email protected]/pkg/nack/generator_interceptor.go:147

2 @ 0x4761ae 0x4893c5 0xa12a54 0x4af0c1
#       0xa12a53        github.com/pion/interceptor/pkg/report.(*ReceiverInterceptor).loop+0x353        /home/ale/go/pkg/mod/github.com/pion/[email protected]/pkg/report/receiver_interceptor.go:100

2 @ 0x4761ae 0x4893c5 0xa15b4d 0x4af0c1
#       0xa15b4c        github.com/pion/interceptor/pkg/report.(*SenderInterceptor).loop+0x3ec  /home/ale/go/pkg/mod/github.com/pion/[email protected]/pkg/report/sender_interceptor.go:116

2 @ 0x4761ae 0x4893c5 0xa19d45 0x4af0c1
#       0xa19d44        github.com/pion/interceptor/pkg/twcc.(*SenderInterceptor).loop+0x1c4    /home/ale/go/pkg/mod/github.com/pion/[email protected]/pkg/twcc/sender_interceptor.go:180

2 @ 0x4761ae 0x4ab4f9 0x4ab4d9 0x4bb615 0x92cb1b 0x9356ce 0xa6476c 0x4af0c1
#       0x4ab4d8        sync.runtime_notifyListWait+0x138                               /usr/local/go/src/runtime/sema.go:569
#       0x4bb614        sync.(*Cond).Wait+0x74                                          /usr/local/go/src/sync/cond.go:70
#       0x92cb1a        github.com/pion/sctp.(*Stream).ReadSCTP+0x21a                   /home/ale/go/pkg/mod/github.com/pion/[email protected]/stream.go:146
#       0x9356cd        github.com/pion/datachannel.(*DataChannel).ReadDataChannel+0x8d /home/ale/go/pkg/mod/github.com/pion/[email protected]/datachannel.go:198
#       0xa6476b        github.com/pion/webrtc/v4.(*DataChannel).readLoop+0xab          /home/ale/dev/webrtc/datachannel.go:355

1 @ 0x46b811 0x4a95dd 0x62f3ea 0x62f1a6 0x62a894 0xb744bb 0x4af0c1
#       0x4a95dc        runtime/pprof.runtime_goroutineProfileWithLabels+0x1c                                   /usr/local/go/src/runtime/mprof.go:1079
#       0x62f3e9        runtime/pprof.writeRuntimeProfile+0xc9                                                  /usr/local/go/src/runtime/pprof/pprof.go:774
#       0x62f1a5        runtime/pprof.writeGoroutine+0x85                                                       /usr/local/go/src/runtime/pprof/pprof.go:734
#       0x62a893        runtime/pprof.(*Profile).WriteTo+0x1b3                                                  /usr/local/go/src/runtime/pprof/pprof.go:369
#       0xb744ba        github.com/pion/webrtc/v4.TestPeerConnection_Zero_PayloadType.TimeOut.func3+0x5a        /home/ale/go/pkg/mod/github.com/pion/transport/[email protected]/test/util.go:24

1 @ 0x4761ae 0x43f8cd 0x43f532 0x59e4b1 0x5a2646 0x59c9ff 0x5a249f 0x59fa78 0xb8b53e 0x475d3d 0x4af0c1
#       0x59e4b0        testing.(*T).Run+0x850          /usr/local/go/src/testing/testing.go:1750
#       0x5a2645        testing.runTests.func1+0x85     /usr/local/go/src/testing/testing.go:2161
#       0x59c9fe        testing.tRunner+0x21e           /usr/local/go/src/testing/testing.go:1689
#       0x5a249e        testing.runTests+0x8be          /usr/local/go/src/testing/testing.go:2159
#       0x59fa77        testing.(*M).Run+0xf17          /usr/local/go/src/testing/testing.go:2027
#       0xb8b53d        main.main+0x2bd                 _testmain.go:551
#       0x475d3c        runtime.main+0x29c              /usr/local/go/src/runtime/proc.go:271

1 @ 0x4761ae 0x43f8cd 0x43f532 0xb16e8f 0x59c9ff 0x4af0c1
#       0xb16e8e        github.com/pion/webrtc/v4.TestPeerConnection_Zero_PayloadType+0x44e     /home/ale/dev/webrtc/peerconnection_media_test.go:1775
#       0x59c9fe        testing.tRunner+0x21e                                                   /usr/local/go/src/testing/testing.go:1689

1 @ 0x4761ae 0x4893c5 0x956858 0xa6ce32 0xa6ce05 0x687892 0xa131d8 0x687892 0xa193b5 0x687892 0xaa6d89 0xacbb9f 0xacc50f 0xa91185 0x4af0c1
#       0x956857        github.com/pion/transport/v3/packetio.(*Buffer).Read+0x317                                      /home/ale/go/pkg/mod/github.com/pion/transport/[email protected]/packetio/buffer.go:267
#       0xa6ce31        github.com/pion/srtp/v3.(*ReadStreamSRTP).Read+0x71                                             /home/ale/go/pkg/mod/github.com/pion/srtp/[email protected]/stream_srtp.go:79
#       0xa6ce04        github.com/pion/webrtc/v4.(*DTLSTransport).streamsForSSRC.func1+0x44                            /home/ale/dev/webrtc/dtlstransport.go:497
#       0x687891        github.com/pion/interceptor.RTPReaderFunc.Read+0x51                                             /home/ale/go/pkg/mod/github.com/pion/[email protected]/interceptor.go:91
#       0xa131d7        github.com/pion/interceptor/pkg/report.(*ReceiverInterceptor).BindRemoteStream.func1+0x97       /home/ale/go/pkg/mod/github.com/pion/[email protected]/pkg/report/receiver_interceptor.go:126
#       0x687891        github.com/pion/interceptor.RTPReaderFunc.Read+0x51                                             /home/ale/go/pkg/mod/github.com/pion/[email protected]/interceptor.go:91
#       0xa193b4        github.com/pion/interceptor/pkg/twcc.(*SenderInterceptor).BindRemoteStream.func1+0xb4           /home/ale/go/pkg/mod/github.com/pion/[email protected]/pkg/twcc/sender_interceptor.go:119
#       0x687891        github.com/pion/interceptor.RTPReaderFunc.Read+0x51                                             /home/ale/go/pkg/mod/github.com/pion/[email protected]/interceptor.go:91
#       0xaa6d88        github.com/pion/webrtc/v4.(*RTPReceiver).readRTP+0x2c8                                          /home/ale/dev/webrtc/rtpreceiver.go:378
#       0xacbb9e        github.com/pion/webrtc/v4.(*TrackRemote).Read+0x25e                                             /home/ale/dev/webrtc/track_remote.go:139
#       0xacc50e        github.com/pion/webrtc/v4.(*TrackRemote).peek+0x4e                                              /home/ale/dev/webrtc/track_remote.go:192
#       0xa91184        github.com/pion/webrtc/v4.(*PeerConnection).startReceiver.func1+0x104                           /home/ale/dev/webrtc/peerconnection.go:1241

panic: timeout

goroutine 202 [running]:
github.com/pion/webrtc/v4.TestPeerConnection_Zero_PayloadType.TimeOut.func3()
        /home/ale/go/pkg/mod/github.com/pion/transport/[email protected]/test/util.go:27 +0xca
created by time.goFunc
        /usr/local/go/src/time/sleep.go:177 +0x45
FAIL    github.com/pion/webrtc/v4       5.029s
FAIL

This patch fixes the issue.

In TestPeerConnection_Zero_PayloadType, WriteSample might be called
after closePairNow, resulting in failure. This patch fixes the issue.
Copy link

codecov bot commented Jun 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.88%. Comparing base (09461d5) to head (821bb82).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2784   +/-   ##
=======================================
  Coverage   78.88%   78.88%           
=======================================
  Files          87       87           
  Lines        8208     8208           
=======================================
  Hits         6475     6475           
  Misses       1264     1264           
  Partials      469      469           
Flag Coverage Δ
go 80.49% <ø> (ø)
wasm 64.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Sean-Der
Copy link
Member

Thank you @aler9! sorry for the delay

@Sean-Der Sean-Der merged commit d56bead into pion:master Jun 16, 2024
17 checks passed
@aler9 aler9 deleted the patch-test-race branch June 16, 2024 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants