Skip to content

Commit

Permalink
Fix SFU reconnect test (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
rogurotus authored Dec 21, 2023
1 parent db329da commit 3fb7389
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion e2e/src/object/tracks_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ impl<T> Object<TracksStore<T>> {
// language=JavaScript
"
async (meta) => {
for (track of meta.store.tracks) {
for (track of meta.store.tracks.reverse()) {
let kind = track.track.kind();
let sourceKind = track.track.media_source_kind();
if (kind === meta.kind
Expand Down
1 change: 1 addition & 0 deletions e2e/tests/steps/track.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ async fn then_remote_media_track(
.unwrap();
let tracks_with_partner = partner_connection.tracks_store().await.unwrap();

sleep(Duration::from_millis(500)).await;
let (media_kind, source_kind) = parse_media_kinds(&kind).unwrap();
let track = tracks_with_partner
.get_track(media_kind, source_kind)
Expand Down
13 changes: 8 additions & 5 deletions flutter/test/e2e/world/member.dart
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,14 @@ class Member {
if (connectionStore.remoteTracks[id]!.values.any((element) =>
sourceCheck(element.last.mediaSourceKind(), source) &&
kindCheck(element.last.kind(), kind))) {
return connectionStore.remoteTracks[id]!.values
.lastWhere((element) =>
sourceCheck(element.last.mediaSourceKind(), source) &&
kindCheck(element.last.kind(), kind))
.last;
return connectionStore.remoteTracks[id]!.values.lastWhere((element) {
var stopped = connectionStore
.callbackCounter[element.last.getTrack().id()]!['stopped']! >
0;
return sourceCheck(element.last.mediaSourceKind(), source) &&
kindCheck(element.last.kind(), kind) &&
!stopped;
}).last;
} else {
var trackCompl = Completer<RemoteMediaTrack>();
connectionStore.onRemoteTrack[id] = (track) {
Expand Down

0 comments on commit 3fb7389

Please sign in to comment.