Skip to content

[fix] Fix warnings in tests.#1

Merged
arekay-nv merged 4 commits intomainfrom
fix/arekay_fix_warnings
Nov 6, 2025
Merged

[fix] Fix warnings in tests.#1
arekay-nv merged 4 commits intomainfrom
fix/arekay_fix_warnings

Conversation

@arekay-nv
Copy link
Copy Markdown
Collaborator

What does this PR do?

Type of change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor/cleanup

Related issues

Testing

  • Tests added/updated
  • All tests pass locally
  • Manual testing completed

Checklist

  • Code follows project style
  • Pre-commit hooks pass
  • Documentation updated (if needed)

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @arekay-nv, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on enhancing the stability and clarity of the benchmarking framework. It ensures that test sessions in the load generator gracefully handle exceptions and always complete their shutdown procedures, preventing orphaned processes or incorrect state. Additionally, it refines the import practices within the test suite to prevent naming conflicts, contributing to a more robust and maintainable codebase.

Highlights

  • Robust Load Generator Shutdown: Implemented a try...except...finally block in the load generator's _run_test method to guarantee that the sample issuer is always shut down and the TEST_ENDED event is recorded, even if an error occurs during the test run. This prevents potential resource leaks or incomplete test state reporting.
  • Resolved TestType Naming Conflict in Unit Tests: Addressed a potential naming collision for the TestType enum within unit tests by aliasing its import as BenchmarkTestType. This improves clarity and avoids ambiguity when other TestType definitions might exist in the test environment.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request primarily addresses warnings in the test suite by aliasing an imported enum and improves the robustness of the benchmark session runner. The changes in the test files are correct and effectively resolve potential pytest collection warnings. In session.py, the addition of a try...finally block is a good enhancement to ensure proper resource cleanup. I have one suggestion to improve exception handling within this new block to make debugging easier by preserving the full stack trace.

)
except Exception as e:
logger.error(f"Error running benchmark session: {e}")
raise e
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using raise e resets the stack trace to this line, which can hide the original location where the exception was raised. For better debuggability, it's preferable to use a bare raise statement inside an except block. This re-raises the caught exception while preserving its full original traceback.

Suggested change
raise e
raise

@nvzhihanj
Copy link
Copy Markdown
Collaborator

@arekay-nv we should probably remove the branch name validator because they don't seem to matter. For the auto request review let's fix it because it will be useful in the future.

For the perf tests that are failing - maybe we need a more capable runner?

@arekay-nv arekay-nv requested a review from a team as a code owner November 6, 2025 15:38
@github-actions
Copy link
Copy Markdown

github-actions bot commented Nov 6, 2025

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

Signed-off-by: Rashid Kaleem <230885705+arekay-nv@users.noreply.github.com>
Signed-off-by: Rashid Kaleem <230885705+arekay-nv@users.noreply.github.com>
Signed-off-by: Rashid Kaleem <230885705+arekay-nv@users.noreply.github.com>
@arekay-nv arekay-nv force-pushed the fix/arekay_fix_warnings branch from 8950969 to 3de32bb Compare November 6, 2025 15:59
@arekay-nv arekay-nv requested a review from a team as a code owner November 6, 2025 15:59
Signed-off-by: Rashid Kaleem <230885705+arekay-nv@users.noreply.github.com>
@arekay-nv arekay-nv merged commit 32b1af8 into main Nov 6, 2025
4 of 5 checks passed
@arekay-nv arekay-nv deleted the fix/arekay_fix_warnings branch November 6, 2025 16:09
@github-actions github-actions bot locked and limited conversation to collaborators Nov 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants