mirror of https://github.com/databricks/cli.git
fix timeout cleanup
This commit is contained in:
parent
a9c53acdff
commit
6cde085b22
|
@ -36,7 +36,7 @@ func TestAccTelemetryLogger(t *testing.T) {
|
||||||
// Extend the maximum wait time for the telemetry flush just for this test.
|
// Extend the maximum wait time for the telemetry flush just for this test.
|
||||||
telemetry.MaxAdditionalWaitTime = 1 * time.Hour
|
telemetry.MaxAdditionalWaitTime = 1 * time.Hour
|
||||||
t.Cleanup(func() {
|
t.Cleanup(func() {
|
||||||
telemetry.MaxAdditionalWaitTime = 2
|
telemetry.MaxAdditionalWaitTime = 2 * time.Second
|
||||||
})
|
})
|
||||||
|
|
||||||
// Log some events.
|
// Log some events.
|
||||||
|
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/databricks/cli/cmd/root"
|
"github.com/databricks/cli/cmd/root"
|
||||||
"github.com/stretchr/testify/assert"
|
"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.
|
// Set the maximum additional wait time to 0 to ensure that the Flush method times out immediately.
|
||||||
MaxAdditionalWaitTime = 0
|
MaxAdditionalWaitTime = 0
|
||||||
t.Cleanup(func() {
|
t.Cleanup(func() {
|
||||||
MaxAdditionalWaitTime = 2
|
MaxAdditionalWaitTime = 2 * time.Second
|
||||||
})
|
})
|
||||||
|
|
||||||
mockClient := &mockDatabricksClient{
|
mockClient := &mockDatabricksClient{
|
||||||
|
|
Loading…
Reference in New Issue