Skip to content

Commit 545011b

Browse files
Fix tests
1 parent 31c8392 commit 545011b

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

shared/python/apimrequests.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,13 @@ def _multiRequest(self, method: HTTP_VERB, path: str, runs: int, headers: list[a
218218
'response_time': response_time
219219
})
220220

221-
if sleepMs is not None:
222-
if sleepMs > 0:
223-
time.sleep(sleepMs / 1000)
224-
else:
225-
time.sleep(SLEEP_TIME_BETWEEN_REQUESTS_MS / 1000) # default sleep time
221+
# Sleep only between requests (not after the final run)
222+
if i < runs - 1:
223+
if sleepMs is not None:
224+
if sleepMs > 0:
225+
time.sleep(sleepMs / 1000)
226+
else:
227+
time.sleep(SLEEP_TIME_BETWEEN_REQUESTS_MS / 1000) # default sleep time
226228
finally:
227229
session.close()
228230

shared/python/utils.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import azure_resources as az
2121
from apimtypes import APIM_SKU, HTTP_VERB, INFRASTRUCTURE, Endpoints, Output, get_project_root
2222
from console import print_error, print_info, print_message, print_ok, print_plain, print_warning, print_val
23-
from logging_config import get_configured_level_name
23+
import logging_config
2424

2525
# Configure warning filter to suppress IPython exit warnings
2626
warnings.filterwarnings(
@@ -48,7 +48,7 @@ def get_deployment_failure_message(deployment_name: str) -> str:
4848
base_message = f"Deployment '{deployment_name}' failed. View deployment details in Azure Portal."
4949

5050
# Only suggest enabling DEBUG logging if it's not already enabled
51-
current_level = get_configured_level_name()
51+
current_level = logging_config.get_configured_level_name()
5252
if current_level != 'DEBUG':
5353
return f"{base_message} Enable DEBUG logging in workspace root .env file, then rerun to see details."
5454

@@ -644,9 +644,8 @@ def find_project_root() -> str:
644644

645645
while current_dir != os.path.dirname(current_dir): # Stop at filesystem root
646646
if any(os.path.exists(os.path.join(current_dir, marker)) for marker in marker_files):
647-
# Additional check: verify this looks like our project by checking for samples directory
648-
if os.path.exists(os.path.join(current_dir, 'samples')):
649-
return current_dir
647+
# Return as soon as marker files are found; do not require 'samples' directory
648+
return current_dir
650649
current_dir = os.path.dirname(current_dir)
651650

652651
# If we can't find the project root, raise an error

0 commit comments

Comments
 (0)