Skip to content

Conversation

@alisonshao
Copy link
Collaborator

Motivation

Modifications

Accuracy Tests

Benchmarking and Profiling

Checklist

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @alisonshao, 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 introduces significant improvements to the test execution framework, primarily by enabling more robust and informative nightly test runs. It allows tests to continue running despite individual failures, which is crucial for gathering complete test coverage data. Additionally, it enhances test reporting with detailed summaries and lays the groundwork for expanding multi-GPU testing capabilities.

Highlights

  • Enhanced Test Execution: The run_unittest_files function now supports a continue_on_error option, allowing test suites (particularly nightly runs) to proceed with subsequent tests even if a test fails or times out, rather than stopping immediately.
  • Detailed Test Summaries: The test runner now provides a comprehensive summary at the end of execution, clearly listing all passed and failed tests along with the specific reasons for any failures (e.g., exit code or timeout).
  • New Nightly Test Configurations: Placeholder configurations have been added for new multi-GPU nightly test suites, including nightly-4-gpu, nightly-8-gpu-h200, and nightly-8-gpu-h20, preparing the infrastructure for future test additions.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/nightly-test.yml
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
Contributor

@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 enhances the test runner by introducing a continue_on_error flag, which is particularly useful for nightly tests to gather all failures instead of stopping at the first one. The implementation is solid, and the addition of a detailed test summary at the end significantly improves the clarity of test results. I have one suggestion to refactor the failure handling logic to reduce code duplication, which should improve maintainability.

Comment on lines 764 to +803
ret_code = run_with_timeout(
run_one_file, args=(filename,), timeout=timeout_per_file
)
assert (
ret_code == 0
), f"expected return code 0, but {filename} returned {ret_code}"
if ret_code != 0:
print(
f"\n✗ FAILED: {filename} returned exit code {ret_code}\n",
flush=True,
)
success = False
failed_tests.append((filename, f"exit code {ret_code}"))
if not continue_on_error:
# Stop at first failure for PR tests
break
# Otherwise continue to next test for nightly tests
else:
passed_tests.append(filename)
except TimeoutError:
kill_process_tree(process.pid)
time.sleep(5)
print(
f"\nTimeout after {timeout_per_file} seconds when running {filename}\n",
f"\n✗ TIMEOUT: {filename} after {timeout_per_file} seconds\n",
flush=True,
)
success = False
break
failed_tests.append((filename, f"timeout after {timeout_per_file}s"))
if not continue_on_error:
# Stop at first timeout for PR tests
break
# Otherwise continue to next test for nightly tests
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The failure handling logic for non-zero exit codes and timeouts is very similar and contains duplicated code. You can refactor this to reduce duplication and improve readability by handling the failure condition after the try...except block.

            failure_reason = None
            try:
                ret_code = run_with_timeout(
                    run_one_file, args=(filename,), timeout=timeout_per_file
                )
                if ret_code == 0:
                    passed_tests.append(filename)
                else:
                    print(
                        f"\n✗ FAILED: {filename} returned exit code {ret_code}\n",
                        flush=True,
                    )
                    failure_reason = f"exit code {ret_code}"
            except TimeoutError:
                kill_process_tree(process.pid)
                time.sleep(5)
                print(
                    f"\n✗ TIMEOUT: {filename} after {timeout_per_file} seconds\n",
                    flush=True,
                )
                failure_reason = f"timeout after {timeout_per_file}s"

            if failure_reason:
                success = False
                failed_tests.append((filename, failure_reason))
                if not continue_on_error:
                    break

@Fridge003
Copy link
Collaborator

Please fix lint with pre-commit run --all-files

@Fridge003 Fridge003 merged commit d3a03ae into main Nov 8, 2025
112 of 121 checks passed
@Fridge003 Fridge003 deleted the add-nightly-test-multi-gpu-configs branch November 8, 2025 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants