Skip to content

test: fix maybe-uninitialized warning in metadata_exchange test - #1473

Merged
brminich merged 2 commits into
ai-dynamo:mainfrom
benlwalker:fix-maybe-uninitialized
Apr 14, 2026
Merged

brminich merged 2 commits into
ai-dynamo:mainfrom
benlwalker:fix-maybe-uninitialized

Conversation

@benlwalker

@benlwalker benlwalker commented Mar 30, 2026 •

Copy link
Copy Markdown
Contributor

What?

Initialize status = NIXL_ERR_NOT_FOUND before the backend creation loop to silence g++ -Werror=maybe-uninitialized.

Why?

This fails to compile on new g++

How?

Initialize the variable before use.

Summary by CodeRabbit

  • Tests
    • Improved reliability of the metadata exchange test by ensuring deterministic initialization of a status variable. This prevents undefined behavior and reduces flakiness, making test outcomes more consistent and stable.

Initialize status = NIXL_ERR_NOT_FOUND before the backend creation
loop to silence g++ -Werror=maybe-uninitialized.

Signed-off-by: Ben Walker <ben@nvidia.com>
@benlwalker
benlwalker requested a review from a team as a code owner March 30, 2026 16:38
@copy-pr-bot

copy-pr-bot Bot commented Mar 30, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions

Copy link
Copy Markdown

👋 Hi benlwalker! Thank you for contributing to ai-dynamo/nixl.

Your PR reviewers will review your contribution then trigger the CI to test your changes.

🚀

@coderabbitai

coderabbitai Bot commented Mar 30, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: f540b9b0-8e70-45a9-ad3b-f36e55092353

📥 Commits

Reviewing files that changed from the base of the PR and between 2279c7d and 863e27b.

📒 Files selected for processing (1)
  • test/gtest/metadata_exchange.cpp

📝 Walkthrough

Walkthrough

A test-local variable status in TEST_F(MetadataExchangeTestFixture, LocalNonLocalMDExchange) was explicitly initialized to NIXL_ERR_NOT_FOUND at declaration to ensure a deterministic value when backend creation does not succeed.

Changes

Cohort / File(s) Summary
Test Variable Initialization
test/gtest/metadata_exchange.cpp
Initialized nixl_status_t status to NIXL_ERR_NOT_FOUND at declaration in LocalNonLocalMDExchange test to avoid an uninitialized variable on some code paths.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐇 I hopped through code at dawn's first light,
Found a status lost from sight,
Gave it a home — NIXL_ERR_NOT_FOUND —
Now tests run steady, safe and sound,
🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: fixing a maybe-uninitialized warning in the metadata_exchange test.
Description check ✅ Passed The description covers all required sections (What, Why, How) with specific details about the initialization fix and compilation issue.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread test/gtest/metadata_exchange.cpp Outdated
@benlwalker
benlwalker force-pushed the fix-maybe-uninitialized branch from 2279c7d to 863e27b Compare April 1, 2026 21:18
@brminich

Copy link
Copy Markdown
Contributor

/ok to test 4e84394

@brminich

Copy link
Copy Markdown
Contributor

/build

@brminich
brminich enabled auto-merge (squash) April 14, 2026 16:13
@brminich
brminich merged commit d645636 into ai-dynamo:main Apr 14, 2026
13 of 14 checks passed

This branch was previously deployed

1 inactive deployment
SWX_AWS — 4e843940 Deployed Apr 14, 2026 by copy-pr-bot[bot] via Run AWS Tests #6654
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants