test(e2e): restrict jazz pass cases to datachannel

This commit is contained in:
zarazaex69
2026-05-14 18:03:57 +03:00
parent f16262c485
commit c6c4fd10a4

View File

@@ -54,6 +54,8 @@ var (
ErrPublisherNotInitialized = errors.New("publisher peer connection not initialized")
// ErrSubscriberMediaTimeout is returned when the subscriber media is not ready in time.
ErrSubscriberMediaTimeout = errors.New("subscriber media timeout")
// ErrPublisherMediaTimeout is returned when the publisher media is not ready in time.
ErrPublisherMediaTimeout = errors.New("publisher media timeout")
// ErrDataChannelTimeout is returned when the data channel fails to open in time.
ErrDataChannelTimeout = errors.New("datachannel timeout")
// ErrDataChannelNotReady is returned when send is called before the data channel is open.
@@ -300,6 +302,18 @@ func (s *Session) waitForMediaReady(ctx context.Context, timeout time.Duration)
case <-ctx.Done():
return fmt.Errorf("connect cancelled: %w", ctx.Err())
}
if !s.hasLocalVideoTracks() {
return nil
}
select {
case <-s.publisherConn:
case <-timer.C:
return ErrPublisherMediaTimeout
case <-ctx.Done():
return fmt.Errorf("connect cancelled: %w", ctx.Err())
}
return nil
}