diff --git a/internal/telemetry_test.go b/internal/telemetry_test.go index 35bb6c0d5..d5f8e0ec3 100644 --- a/internal/telemetry_test.go +++ b/internal/telemetry_test.go @@ -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. diff --git a/libs/telemetry/logger_test.go b/libs/telemetry/logger_test.go index ff84c1f18..8ae38942b 100644 --- a/libs/telemetry/logger_test.go +++ b/libs/telemetry/logger_test.go @@ -5,6 +5,7 @@ import ( "fmt" "net/http" "testing" + "time" "github.com/databricks/cli/cmd/root" "github.com/stretchr/testify/assert" @@ -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{