From 13b4a614b1bd912df19b0ba66f1d576a4472c4ce Mon Sep 17 00:00:00 2001 From: Eric Daniels Date: Fri, 2 Aug 2024 13:05:41 -0400 Subject: [PATCH] Fix TestPeerConnection_EventHandlers flake - Fixes #2848 --- peerconnection_test.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/peerconnection_test.go b/peerconnection_test.go index 01a0b24c547..12811ebce22 100644 --- a/peerconnection_test.go +++ b/peerconnection_test.go @@ -387,11 +387,7 @@ func TestPeerConnection_EventHandlers(t *testing.T) { wg.Done() }) }) - pcOffer.OnConnectionStateChange(func(callbackState PeerConnectionState) { - if storedState := pcOffer.ConnectionState(); callbackState != storedState { - t.Errorf("State in callback argument is different from ConnectionState(): callbackState=%s, storedState=%s", callbackState, storedState) - } - + pcOffer.OnConnectionStateChange(func(PeerConnectionState) { onceOffererOnConnectionStateChange.Do(func() { wasCalledMut.Lock() defer wasCalledMut.Unlock()