diff --git a/test/client/datachannel_reader.go b/test/client/datachannel_reader.go index e43d8908..2b8c7210 100644 --- a/test/client/datachannel_reader.go +++ b/test/client/datachannel_reader.go @@ -21,7 +21,7 @@ func NewDataChannelReader(bitrate int) *DataChannelReader { func (d *DataChannelReader) Read(p []byte, sid string) { for { if bitrate := d.bitrate.Bitrate(time.Now()); bitrate > 0 && bitrate > d.target { - time.Sleep(20 * time.Millisecond) + time.Sleep(10 * time.Millisecond) d.bitrate.AddBytes(0, 0, time.Now()) continue } diff --git a/test/singlenode_test.go b/test/singlenode_test.go index 5ab7c868..6f993eab 100644 --- a/test/singlenode_test.go +++ b/test/singlenode_test.go @@ -715,7 +715,7 @@ func TestDataPublishSlowSubscriber(t *testing.T) { return } - dataChannelSlowThreshold := 101024 + dataChannelSlowThreshold := 21024 logger.Infow("----------------STARTING TEST----------------", "test", t.Name()) s := createSingleNodeServer(func(c *config.Config) { @@ -818,13 +818,13 @@ func TestDataPublishSlowSubscriber(t *testing.T) { time.Sleep(time.Second) blocked.Store(false) require.Eventually(t, func() bool { return blocked.Load() }, 30*time.Second, 100*time.Millisecond) - drainSlowSubNotDrop.Store(true) stopWrite.Store(true) <-writeStopped + drainSlowSubNotDrop.Store(true) require.Eventually(t, func() bool { return writeIdx.Load() == fastDataIndex.Load() && writeIdx.Load() == slowNoDropDataIndex.Load() - }, 5*time.Second, 50*time.Millisecond) + }, 10*time.Second, 50*time.Millisecond, "writeIdx %d, fast %d, slowNoDrop %d", writeIdx.Load(), fastDataIndex.Load(), slowNoDropDataIndex.Load()) } func TestFireTrackBySdp(t *testing.T) {