Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(tests): tolerate transient Firefox ICE disconnect in waitForIceConnected

damenchoea2cdacdb00b
diff --git a/tests/helpers/Participant.ts b/tests/helpers/Participant.ts
index 5a8e38149a..6a46647e7a 100644
--- a/tests/helpers/Participant.ts
+++ b/tests/helpers/Participant.ts
@@ -451,7 +451,25 @@ export class Participant {
*/
waitForIceConnected(): Promise<boolean> {
return this.driver.waitUntil(() =>
- this.execute(() => APP?.conference?.getConnectionState() === 'connected'), {
+ this.execute(() => {
+ const state = APP?.conference?.getConnectionState();
+
+ if (state === 'connected') {
+ return true;
+ }
+
+ // Firefox can leave the JVB PeerConnection reporting a transient ICE
+ // 'disconnected' state (a brief consent-check blip) while the selected
+ // candidate pair keeps carrying media, and it does not always transition
+ // back to 'connected' the way Chrome does. Treat that as connected when
+ // stats show we are actually receiving media from the bridge, so a momentary
+ // disconnect does not fail the whole spec. Terminal 'failed'/'closed' keep waiting.
+ if (state === 'disconnected') {
+ return APP?.conference?.getStats()?.bitrate?.download > 0;
+ }
+
+ return false;
+ }), {
timeout: 15_000,
timeoutMsg: `expected ICE to be connected for 15s for ${this.name}`
});