Skip to content

Commit

Permalink
fix timeout cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyas-goenka committed Nov 29, 2024
1 parent a9c53ac commit 6cde085
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/telemetry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestAccTelemetryLogger(t *testing.T) {
// Extend the maximum wait time for the telemetry flush just for this test.
telemetry.MaxAdditionalWaitTime = 1 * time.Hour
t.Cleanup(func() {
telemetry.MaxAdditionalWaitTime = 2
telemetry.MaxAdditionalWaitTime = 2 * time.Second
})

// Log some events.
Expand Down
3 changes: 2 additions & 1 deletion libs/telemetry/logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"net/http"
"testing"
"time"

"github.com/databricks/cli/cmd/root"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -78,7 +79,7 @@ func TestTelemetryLoggerFlushExitsOnTimeout(t *testing.T) {
// Set the maximum additional wait time to 0 to ensure that the Flush method times out immediately.
MaxAdditionalWaitTime = 0
t.Cleanup(func() {
MaxAdditionalWaitTime = 2
MaxAdditionalWaitTime = 2 * time.Second
})

mockClient := &mockDatabricksClient{
Expand Down

0 comments on commit 6cde085

Please sign in to comment.