Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyas-goenka committed Dec 20, 2024
1 parent 1912ebd commit bb9747e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions integration/libs/telemetry/telemetry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,22 @@ func TestTelemetryLogger(t *testing.T) {
})

// Log some events.
telemetry.Log(ctx, telemetry.FrontendLogEntry{
err := telemetry.Log(ctx, telemetry.FrontendLogEntry{
DatabricksCliLog: telemetry.DatabricksCliLog{
CliTestEvent: telemetry.CliTestEvent{
Name: telemetry.DummyCliEnumValue1,
},
},
})
telemetry.Log(ctx, telemetry.FrontendLogEntry{
require.NoError(t, err)
err = telemetry.Log(ctx, telemetry.FrontendLogEntry{
DatabricksCliLog: telemetry.DatabricksCliLog{
CliTestEvent: telemetry.CliTestEvent{
Name: telemetry.DummyCliEnumValue2,
},
},
})
require.NoError(t, err)

apiClient, err := client.New(w.W.Config)
require.NoError(t, err)
Expand Down
3 changes: 2 additions & 1 deletion libs/telemetry/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ var MaxAdditionalWaitTime = 2 * time.Second
// batching the logs across multiple API calls.
func Flush(ctx context.Context, apiClient DatabricksApiClient) {
// Set a maximum time to wait for the telemetry event to flush.
ctx, _ = context.WithTimeout(ctx, MaxAdditionalWaitTime)
ctx, cancel := context.WithTimeout(ctx, MaxAdditionalWaitTime)
defer cancel()
l := fromContext(ctx)

// We pass the API client as an arg to mock it in unit tests.
Expand Down

0 comments on commit bb9747e

Please sign in to comment.