Skip to content

Commit f3dc334

Browse files
aauschclaude
andcommitted
fix(test): add HTTPTransport stubs to prevent hanging in TestAzureGithubOIDCCredentials
EnsureResolved now calls resolveHostMetadata, which makes a real network request when no HTTPTransport is set. Four test cases with a Host but no transport were hanging indefinitely. Add an empty MappingTransport to each so the host-metadata request gets a fast "missing stub" error and falls back gracefully. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Alex Ausch <alex@ausch.name>
1 parent 8d7ab71 commit f3dc334

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

NEXT_CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
### Internal Changes
2222

2323
* Normalize internal token sources on `auth.TokenSource` for proper context propagation ([#1577](https://github.com/databricks/databricks-sdk-go/pull/1577)).
24+
* Fix `TestAzureGithubOIDCCredentials` hang caused by missing `HTTPTransport` stub: `EnsureResolved` now calls `resolveHostMetadata`, which makes a real network request when no transport is set ([#1550](https://github.com/databricks/databricks-sdk-go/pull/1550)).
2425
* Bump golang.org/x/crypto from 0.21.0 to 0.45.0 in /examples/slog ([#1566](https://github.com/databricks/databricks-sdk-go/pull/1566)).
2526
* Bump golang.org/x/net from 0.23.0 to 0.33.0 in /examples/slog ([#1127](https://github.com/databricks/databricks-sdk-go/pull/1127)).
2627
* Bump golang.org/x/oauth2 from 0.20.0 to 0.27.0 ([#1563](https://github.com/databricks/databricks-sdk-go/pull/1563)).

config/auth_azure_github_oidc_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ func TestAzureGithubOIDCCredentials(t *testing.T) {
4949
AzureTenantID: "test-tenant-id",
5050
ActionsIDTokenRequestURL: "http://endpoint.com/test?version=1",
5151
ActionsIDTokenRequestToken: "token-1337",
52+
HTTPTransport: fixtures.MappingTransport{},
5253
},
5354
wantErrPrefix: errPrefix("github-oidc-azure auth: not configured"),
5455
},
@@ -79,6 +80,7 @@ func TestAzureGithubOIDCCredentials(t *testing.T) {
7980
AzureClientID: "test-client-id",
8081
ActionsIDTokenRequestURL: "http://endpoint.com/test?version=1",
8182
ActionsIDTokenRequestToken: "token-1337",
83+
HTTPTransport: fixtures.MappingTransport{},
8284
},
8385
wantErrPrefix: errPrefix("github-oidc-azure auth: not configured"),
8486
},
@@ -94,6 +96,7 @@ func TestAzureGithubOIDCCredentials(t *testing.T) {
9496
AzureTenantID: "test-tenant-id",
9597
Host: "http://host.com/test",
9698
ActionsIDTokenRequestURL: "http://endpoint.com/test?version=1",
99+
HTTPTransport: fixtures.MappingTransport{},
97100
},
98101
wantErrPrefix: errPrefix("github-oidc-azure auth: not configured"),
99102
},
@@ -109,6 +112,7 @@ func TestAzureGithubOIDCCredentials(t *testing.T) {
109112
AzureTenantID: "test-tenant-id",
110113
Host: "http://host.com/test",
111114
ActionsIDTokenRequestToken: "token-1337",
115+
HTTPTransport: fixtures.MappingTransport{},
112116
},
113117
wantErrPrefix: errPrefix("github-oidc-azure auth: not configured"),
114118
},

0 commit comments

Comments
 (0)