Skip to content

Commit 46f7592

Browse files
committed
An explicit short timeout is needed because the test case is run outside of Azure VM
1 parent b0f3299 commit 46f7592

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/test_e2e.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ def get_lab_app(
353353
env_client_secret="LAB_APP_CLIENT_SECRET",
354354
authority="https://login.microsoftonline.com/"
355355
"72f988bf-86f1-41af-91ab-2d7cd011db47", # Microsoft tenant ID
356+
timeout=None,
356357
**kwargs):
357358
"""Returns the lab app as an MSAL confidential client.
358359
@@ -379,7 +380,7 @@ def get_lab_app(
379380
client_id,
380381
client_credential=client_secret,
381382
authority=authority,
382-
http_client=MinimalHttpClient(),
383+
http_client=MinimalHttpClient(timeout=timeout),
383384
**kwargs)
384385

385386
def get_session(lab_app, scopes): # BTW, this infrastructure tests the confidential client flow
@@ -754,6 +755,7 @@ def test_acquire_token_for_client_should_hit_regional_endpoint(self):
754755

755756
authority="https://login.microsoftonline.com/microsoft.onmicrosoft.com",
756757
region=self.region, # Explicitly use this region, regardless of detection
758+
timeout=2, # Short timeout makes this test case responsive on non-VM
757759
)
758760
scopes = ["https://graph.microsoft.com/.default"]
759761
result = self.app.acquire_token_for_client(

0 commit comments

Comments
 (0)