init ua parser once (#3883)

This commit is contained in:
Paul Wells
2025-08-28 05:20:25 -07:00
committed by GitHub
parent 998a9f9404
commit 2aeadf14dc
3 changed files with 23 additions and 8 deletions
+3 -2
View File
@@ -15,7 +15,6 @@
package rtc
import (
"fmt"
"math/rand/v2"
"strings"
"testing"
@@ -63,12 +62,14 @@ func TestChunkProtoBatch(t *testing.T) {
target := 64 * 1024
batches := ChunkProtoBatch(updates, target)
var count int
for _, b := range batches {
var sum int
for _, m := range b {
sum += proto.Size(m)
count++
}
require.True(t, sum < target || len(b) == 1, "batch size exceeds target")
}
fmt.Println(len(batches))
require.Equal(t, len(updates), count)
}