From 53ddb0a74bc84eed98a85b3584b32f724a33345a Mon Sep 17 00:00:00 2001 From: Tim Ross Date: Mon, 21 Oct 2024 09:25:41 -0400 Subject: [PATCH] Fix flaky TestInitDatabaseService Addresses two separate issues caused by using t.TempDir as the data directory in the test. - Session recording is disabled to avoid cleanup problems with a non-empty data dir - The debug service is disabled to prevent long unix socket paths from failing tests on macOS Closes #42963 --- lib/service/service_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/service/service_test.go b/lib/service/service_test.go index 03cc14e362b94..b94d776627999 100644 --- a/lib/service/service_test.go +++ b/lib/service/service_test.go @@ -1785,12 +1785,16 @@ func TestInitDatabaseService(t *testing.T) { cfg := servicecfg.MakeDefaultConfig() cfg.DataDir = t.TempDir() + cfg.DebugService = servicecfg.DebugConfig{ + Enabled: false, + } cfg.Auth.StorageConfig.Params["path"] = t.TempDir() cfg.Hostname = "default.example.com" cfg.Auth.Enabled = true cfg.SetAuthServerAddress(utils.NetAddr{AddrNetwork: "tcp", Addr: "127.0.0.1:0"}) cfg.Auth.ListenAddr = utils.NetAddr{AddrNetwork: "tcp", Addr: "127.0.0.1:0"} cfg.Auth.StorageConfig.Params["path"] = t.TempDir() + cfg.Auth.SessionRecordingConfig.SetMode(types.RecordOff) cfg.Proxy.Enabled = true cfg.Proxy.DisableWebInterface = true cfg.Proxy.WebAddr = utils.NetAddr{AddrNetwork: "tcp", Addr: "localhost:0"}