Skip to content

Commit

Permalink
Fix tctl test timeouts (#24218)
Browse files Browse the repository at this point in the history
  • Loading branch information
r0mant authored Apr 6, 2023
1 parent 2693492 commit b24ebf1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tool/tctl/common/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,13 @@ func makeAndRunTestAuthServer(t *testing.T, opts ...testServerOptionFunc) (auth
// timeout here because this isn't the kind of problem that this test is meant to catch.
require.NoError(t, err, "auth server didn't start after 30s")

// Wait for proxy to start up if it's enabled. Otherwise we may get racy
// behavior between startup and shutdown.
if cfg.Proxy.Enabled {
_, err = auth.WaitForEventTimeout(30*time.Second, service.ProxyWebServerReady)
require.NoError(t, err, "proxy server didn't start after 30s")
}

return auth
}

Expand Down
3 changes: 3 additions & 0 deletions tool/tctl/common/resource_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ func TestAppResource(t *testing.T) {
fileConfig := &config.FileConfig{
Global: config.Global{
DataDir: t.TempDir(),
Logger: config.Log{
Severity: "debug",
},
},
Apps: config.Apps{
Service: config.Service{
Expand Down

0 comments on commit b24ebf1

Please sign in to comment.