Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable debug log to track down test flakes in TestConnector_Run #3566

Merged
merged 1 commit into from
Nov 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions internal/cmd/connector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/infrahq/infra/internal/certs"
"github.com/infrahq/infra/internal/cmd/types"
"github.com/infrahq/infra/internal/connector"
"github.com/infrahq/infra/internal/logging"
"github.com/infrahq/infra/internal/server"
"github.com/infrahq/infra/internal/server/data"
"github.com/infrahq/infra/internal/server/models"
Expand All @@ -38,6 +39,11 @@ func TestConnector_Run(t *testing.T) {
t.Skip("too slow for short run")
}

assert.NilError(t, logging.SetLevel("debug"))
t.Cleanup(func() {
assert.NilError(t, logging.SetLevel("info"))
})

dir := t.TempDir()
serverOpts := defaultServerOptions(dir)
setupServerOptions(t, &serverOpts)
Expand Down Expand Up @@ -84,7 +90,7 @@ func TestConnector_Run(t *testing.T) {
},
}

ctx, cancel := context.WithTimeout(ctx, 20*time.Second)
ctx, cancel := context.WithTimeout(ctx, 30*time.Second)
t.Cleanup(cancel)

runAndWait(ctx, t, func(ctx context.Context) error {
Expand All @@ -103,7 +109,7 @@ func TestConnector_Run(t *testing.T) {
return poll.Error(err)
}
return poll.Success()
})
}, poll.WithTimeout(30*time.Second))

// check the destination was updated
expected := &models.Destination{
Expand Down