Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
fix logging races when -count > 10
Browse files Browse the repository at this point in the history
  • Loading branch information
sergicastro committed Feb 29, 2024
1 parent 482439f commit d208009
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions internal/logging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,17 @@ import (
)

func TestGetLogger(t *testing.T) {
l1 := scope.Register("l1", "test logger one")
var (
logger1Name = "l1"
// do not reuse this name in other tests, otherwise multiple runs of the test may fail due find it registered
noLoggerName = "lnoop"
)
l1 := scope.Register(logger1Name, "test logger one")

NewLogSystem(telemetry.NoopLogger(), nil)

require.Equal(t, l1, Logger("l1"))
require.Equal(t, telemetry.NoopLogger(), Logger("l2"))
require.Equal(t, l1, Logger(logger1Name))
require.Equal(t, telemetry.NoopLogger(), Logger(noLoggerName))
}

func TestLoggingSetup(t *testing.T) {
Expand Down

0 comments on commit d208009

Please sign in to comment.