Skip to content

fix: Use exit 77 for skipped tests in test-rdma.sh#113

Open
ggoklani wants to merge 1 commit intolinux-system-roles:mainfrom
ggoklani:fix_rdma_test_script
Open

fix: Use exit 77 for skipped tests in test-rdma.sh#113
ggoklani wants to merge 1 commit intolinux-system-roles:mainfrom
ggoklani:fix_rdma_test_script

Conversation

@ggoklani
Copy link
Copy Markdown
Collaborator

@ggoklani ggoklani commented Mar 26, 2026

Fix RDMA test script and service boot reliability
Changes:

  1. Update test-rdma.sh to use exit code 77 for skipped tests (following
    test-nvidia-docker.sh pattern) instead of exit 0, avoiding brittle
    string assertions in test framework

  2. Fix azure_persistent_rdma_naming.service boot failures caused by race intermidiatly
    conditions during system startup:(intermediately)

    • Remove 'set -e' from naming script to prevent early exit on
      transient device initialization failures
    • Add error handling for rdma_rename failures with warning messages
    • Add systemd service retry logic (Restart=on-failure, RestartSec=2,
      StartLimitBurst=3) to handle boot-time race conditions

🤖 Generated with Claude Code

Signed-off-by: Gaurav Goklani ggoklani@redhat.com

Summary by Sourcery

Align RDMA test script exit codes with established convention for skipped tests by introducing a dedicated skip path and adjusting Azure/systemd checks accordingly.

Bug Fixes:

  • Treat skipped RDMA checks as exit code 77 instead of success to let test harnesses distinguish skipped from passed runs.

Enhancements:

  • Introduce a reusable skip() helper in test-rdma.sh and simplify messaging for skipped Azure/systemd checks.

@ggoklani ggoklani requested review from richm and spetrosi as code owners March 26, 2026 05:38
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Mar 26, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Aligns test-rdma.sh skip behavior with other test scripts by introducing a skip helper that exits with code 77 and using it for environment-based skips, while simplifying output for skipped checks.

File-Level Changes

Change Details Files
Introduce a skip helper that standardizes skipped-test exit behavior.
  • Add skip() function that prints a skip reason and exits with code 77
  • Document skip behavior implicitly by colocating with fail() for test outcome handling
files/rdma/test-rdma.sh
Use skip() instead of returning success for environment-based skips.
  • Replace Azure vendor mismatch early return with a skip() call and concise skip message
  • Replace non-systemd early return with a skip() call and concise skip message
  • Remove verbose "Test Passed" messaging for scenarios that are actually skipped, not passed
files/rdma/test-rdma.sh

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Changes:
1. Update test-rdma.sh to use exit code 77 for skipped tests (following
   test-nvidia-docker.sh pattern) instead of exit 0, avoiding brittle
   string assertions in test framework

2. Fix azure_persistent_rdma_naming.service boot failures caused by race
   conditions during system startup:
   - Remove 'set -e' from naming script to prevent early exit on
     transient device initialization failures
   - Add error handling for rdma_rename failures with warning messages
   - Add systemd service retry logic (Restart=on-failure, RestartSec=2,
     StartLimitBurst=3) to handle boot-time race conditions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Gaurav Goklani <ggoklani@redhat.com>
@ggoklani ggoklani force-pushed the fix_rdma_test_script branch from 6e87dcf to 3155fb5 Compare March 26, 2026 13:33
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.

2 participants