Skip to content
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: 10 additions & 0 deletions integration/libs/telemetry/telemetry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ package telemetry

import (
"encoding/json"
"errors"
"net/http"
"testing"
"time"
"uuid"

"github.com/databricks/cli/integration/internal/acc"
"github.com/databricks/cli/libs/telemetry"
"github.com/databricks/cli/libs/telemetry/protos"
"github.com/databricks/databricks-sdk-go/apierr"
"github.com/databricks/databricks-sdk-go/client"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -56,6 +59,13 @@ func TestTelemetryEndpoint(t *testing.T) {
respB := telemetry.ResponseBody{}

err = apiClient.Do(ctx, "POST", "/telemetry-ext", nil, nil, reqB, &respB)
// The SDK retries 429 responses for its full retry timeout (5 minutes).
// A 429 that outlasts it means the shared test workspace is throttling
// /telemetry-ext because of traffic from other concurrent CI runs; it
// says nothing about whether the endpoint accepts these logs.
if aerr, ok := errors.AsType[*apierr.APIError](err); ok && aerr.StatusCode == http.StatusTooManyRequests {
t.Skipf("/telemetry-ext is rate limited on this workspace: %s", aerr.Message)
}
require.NoError(t, err)

assert.Equal(t, telemetry.ResponseBody{
Expand Down
Loading