mirror of
https://github.com/gravitational/teleport
synced 2024-10-21 17:53:28 +00:00
Fixes racey tests in tsh
(#7416)
Multiple routines were fighting over the global logrus `Logger` instance, causing the race detector to trip roughly once in every 10 test runs. This patch addresses this race condition by supplying each of the competing processes an entirely separate logger, and ensuring that these log instances are plumbed through to the code that would otherwise trip the race detector.
This commit is contained in:
parent
90f186df37
commit
9b7002cf9c
|
@ -2512,6 +2512,7 @@ func (process *TeleportProcess) initProxyEndpoint(conn *Connector) error {
|
|||
PollingPeriod: process.Config.PollingPeriod,
|
||||
FIPS: cfg.FIPS,
|
||||
Emitter: streamEmitter,
|
||||
Log: process.log,
|
||||
})
|
||||
if err != nil {
|
||||
return trace.Wrap(err)
|
||||
|
|
|
@ -807,6 +807,7 @@ func makeTestServers(t *testing.T, bootstrap ...types.Resource) (auth *service.T
|
|||
cfg.Auth.Enabled = true
|
||||
cfg.Auth.SSHAddr = randomLocalAddr
|
||||
cfg.Proxy.Enabled = false
|
||||
cfg.Log = utils.NewLoggerForTests()
|
||||
|
||||
auth, err = service.NewTeleport(cfg)
|
||||
require.NoError(t, err)
|
||||
|
@ -844,6 +845,7 @@ func makeTestServers(t *testing.T, bootstrap ...types.Resource) (auth *service.T
|
|||
cfg.Proxy.SSHAddr = randomLocalAddr
|
||||
cfg.Proxy.ReverseTunnelListenAddr = randomLocalAddr
|
||||
cfg.Proxy.DisableWebInterface = true
|
||||
cfg.Log = utils.NewLoggerForTests()
|
||||
|
||||
proxy, err = service.NewTeleport(cfg)
|
||||
require.NoError(t, err)
|
||||
|
|
Loading…
Reference in a new issue