mirror of
https://github.com/livekit/livekit.git
synced 2026-09-18 20:54:48 +00:00
rtc tests: give the logger its own logging config
init() handed the logger &config.DefaultConfig.Logging, so the leveler's mutex lived inside the global that NewConfig yaml-marshals. Marshalling reflectively copies the whole struct, mutex included, which raced the component-level lookups pion makes from its own goroutines and failed TestPreferMediaCodecForPublisher under -race. The values are the same; only the storage is now test-local. The integration helper aliased the same global and gets the same treatment.
This commit is contained in:
@@ -51,7 +51,11 @@ const (
|
||||
)
|
||||
|
||||
func init() {
|
||||
config.InitLoggerFromConfig(&config.DefaultConfig.Logging)
|
||||
// the logger keeps this pointer, so it needs storage of its own: NewConfig
|
||||
// yaml-marshals DefaultConfig, which reflectively copies the leveler's mutex
|
||||
// while pion goroutines are locking it.
|
||||
logging := config.LoggingConfig{PionLevel: config.DefaultConfig.Logging.PionLevel}
|
||||
config.InitLoggerFromConfig(&logging)
|
||||
roomUpdateInterval = defaultDelay
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,11 @@ const (
|
||||
var roomClient livekit.RoomService
|
||||
|
||||
func init() {
|
||||
config.InitLoggerFromConfig(&config.DefaultConfig.Logging)
|
||||
// the logger keeps this pointer, so it needs storage of its own: NewConfig
|
||||
// yaml-marshals DefaultConfig, which reflectively copies the leveler's mutex
|
||||
// while pion goroutines are locking it.
|
||||
logging := config.LoggingConfig{PionLevel: config.DefaultConfig.Logging.PionLevel}
|
||||
config.InitLoggerFromConfig(&logging)
|
||||
|
||||
prometheus.Init("test", livekit.NodeType_SERVER)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user