Skip to content

Commit 1cb8f84

Browse files
Merge pull request #268 from microsoft/fix/code-quality-issues-48033
fix: resolve code quality findings
2 parents ad6a269 + 20a20bb commit 1cb8f84

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/api/app/routers/voice_live.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ async def stop(self) -> None:
180180
if callable(close_fn):
181181
close_result = close_fn()
182182
if inspect.isawaitable(close_result):
183-
await close_result
183+
# Bind the awaited result so the statement has an observable effect.
184+
_ = await close_result
184185

185186
async def _run(self) -> None:
186187
try:

tests/e2e-test/pages/webUserPage.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def click_send_button(self):
3838
try:
3939
stop_btn.wait_for(state="visible", timeout=15000)
4040
except PlaywightTimeoutError:
41+
# Short/instant replies may never render the stop button; proceed to wait for hidden.
4142
pass
4243
stop_btn.wait_for(state="hidden", timeout=60000)
4344

@@ -61,6 +62,7 @@ def wait_for_response(self, timeout=30000):
6162
try:
6263
stop_btn.wait_for(state="hidden", timeout=timeout)
6364
except PlaywightTimeoutError:
65+
# Stop button may already be gone; fall through and check response content below.
6466
pass
6567

6668
# Wait for AI response to appear by looking for response indicators
@@ -291,8 +293,10 @@ def get_new_ai_response(self, initial_count):
291293
if cleaned and cleaned.lower() != "ai-generated content may be incorrect":
292294
return cleaned
293295
except PlaywightTimeoutError:
296+
# Bubble may be mid-render; retry on the next loop iteration.
294297
pass
295298
except Exception:
299+
# Transient read error during re-render; retry on the next loop iteration.
296300
pass
297301
self.page.wait_for_timeout(1000)
298302
return ""

tests/e2e-test/tests/test_byocc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ def test_28935_new_session_clears_previous_data(self, page):
480480
clicked_new_session = True
481481
break
482482
except Exception:
483+
# Force-click fallback failed; the assertion below reports if no strategy succeeded.
483484
pass
484485

485486
assert clicked_new_session, "New Session button should be available and clickable"

0 commit comments

Comments
 (0)