Skip to content

[Testing] Replace bare except clauses in e2e tests - #2650

Open
arijitroy003 wants to merge 1 commit into
vllm-project:mainfrom
arijitroy003:fix/replace-bare-excepts
Open

[Testing] Replace bare except clauses in e2e tests#2650
arijitroy003 wants to merge 1 commit into
vllm-project:mainfrom
arijitroy003:fix/replace-bare-excepts

Conversation

@arijitroy003

Copy link
Copy Markdown
Contributor

Purpose

Replace bare except: clauses in e2e tests with specific exception types to prevent catching KeyboardInterrupt and SystemExit, which can interfere with test interruption and cleanup.

Changes

  • e2e/testing/05-jailbreak-test.py: Replace bare except: with except (json.JSONDecodeError, KeyError, IndexError, Exception):
  • e2e/testing/06-pii-detection-test.py: Replace bare except: with except (json.JSONDecodeError, KeyError, IndexError, Exception): in two locations

All changes are in JSON response parsing blocks where the code handles OpenAI-compatible API responses.

Test Plan

Verified by grep that no bare except: clauses remain in e2e/ directory:

grep -rn "except:" e2e/ --include="*.py"
# No output - all replaced

Test Result

No functional changes to test behavior. Tests continue to handle response parsing failures with the same fallback message.

…n e2e tests

Bare except clauses catch KeyboardInterrupt and SystemExit, which can
interfere with test interruption and cleanup. Replace with specific
exception types for JSON parsing and dictionary access operations.

Changes:
- e2e/testing/05-jailbreak-test.py: Specify (json.JSONDecodeError, KeyError, IndexError, Exception)
- e2e/testing/06-pii-detection-test.py: Specify (json.JSONDecodeError, KeyError, IndexError, Exception) in two locations

Signed-off-by: arijitroy003 <arijitroy003@gmail.com>
@netlify

netlify Bot commented Jul 23, 2026

Copy link
Copy Markdown

Deploy Preview for vllm-semantic-router ready!

Name Link
🔨 Latest commit f2cb0f5
🔍 Latest deploy log https://app.netlify.com/projects/vllm-semantic-router/deploys/6a622ea78da632000af95c9d
😎 Deploy Preview https://deploy-preview-2650--vllm-semantic-router.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

Copy link
Copy Markdown
Contributor

👥 vLLM Semantic Team Notification

The following members have been identified for the changed files in this PR and have been automatically assigned when their GitHub accounts are assignable in this repository:

📁 e2e

Owners: @FAUST-BENCHOU, @shraderdm, @drivebyer, @ramkrishs, @WUKUNTAI-0211, @AayushSaini101, @siloteemu
Files changed:

  • e2e/testing/05-jailbreak-test.py
  • e2e/testing/06-pii-detection-test.py

vLLM Semantic Router

🎉 Thanks for your contributions!

This comment was automatically generated based on the OWNER files in the repository.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Supply Chain Security Report — All Clear

Scanner Status Findings
AST Codebase Scan (Py, Go, JS/TS, Rust) 29 finding(s) — MEDIUM: 22 · LOW: 7
AST PR Diff Scan No issues detected
Regex Fallback Scan No issues detected

Scanned at 2026-07-23T15:23:24.071Z · View full workflow logs

@AayushSaini101

Copy link
Copy Markdown
Collaborator

thanks for the contributing, kindly create an issue and linked to the MR : )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants