File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 77 "fmt"
88 "io"
99 "net/http"
10+ "net/url"
1011 "testing"
1112 "time"
1213
@@ -245,14 +246,18 @@ func TestContinuousRefreshTokenConcurrency(t *testing.T) {
245246 ctx , cancel := context .WithCancel (ctx )
246247 defer cancel () // This cancels the refresher goroutine
247248
249+ // Extract host from tokenAPI constant for consistency
250+ tokenURL , _ := url .Parse (tokenAPI )
251+ tokenHost := tokenURL .Host
252+
248253 // The Do() routine, that both the keyFlow and continuousRefreshToken() use to make their requests
249254 // The bools are used to make sure only one request goes through on each test phase
250255 doTestPhase1RequestDone := false
251256 doTestPhase2RequestDone := false
252257 doTestPhase4RequestDone := false
253258 mockDo := func (req * http.Request ) (resp * http.Response , err error ) {
254259 // Handle auth requests (token refresh)
255- if req .URL .Host == "service-account.api.stackit.cloud" {
260+ if req .URL .Host == tokenHost {
256261 switch currentTestPhase {
257262 default :
258263 // After phase 1, allow additional auth requests but don't fail the test
You can’t perform that action at this time.
0 commit comments