[Testing] Replace bare except clauses in e2e tests - #2650
Open
arijitroy003 wants to merge 1 commit into
Open
Conversation
…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>
✅ Deploy Preview for vllm-semantic-router ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
👥 vLLM Semantic Team NotificationThe 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: 📁
|
Contributor
✅ Supply Chain Security Report — All Clear
Scanned at |
Collaborator
|
thanks for the contributing, kindly create an issue and linked to the MR : ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
except:withexcept (json.JSONDecodeError, KeyError, IndexError, Exception):except:withexcept (json.JSONDecodeError, KeyError, IndexError, Exception):in two locationsAll 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:Test Result
No functional changes to test behavior. Tests continue to handle response parsing failures with the same fallback message.