Skip to content

fix(test): set LimitSet on quota fixtures added in #2347 - #2408

Closed
veyron-kairo wants to merge 1 commit into
Project-HAMi:masterfrom
veyron-kairo:fix/quota-limitset-test-fixtures
Closed

fix(test): set LimitSet on quota fixtures added in #2347#2408
veyron-kairo wants to merge 1 commit into
Project-HAMi:masterfrom
veyron-kairo:fix/quota-limitset-test-fixtures

Conversation

@veyron-kairo

@veyron-kairo veyron-kairo commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?
/kind bug

What this PR does / why we need it:
master is red on the scheduler unit tests right now. #2313 changed FitQuota to gate on LimitSet instead of Limit != 0, so an explicit ResourceQuota of "0" is honored as a hard block. The quota tests added in #2347 build device.Quota values directly with only Limit set, so once both landed on master those limits read as "not configured" and the over-quota cases got admitted instead of denied. AddQuota sets LimitSet in the real path, so this sets it in the fixtures to match.

Both PRs passed CI on their own base and only conflict once they're on master together, which is why neither run caught it.

Tests this brings back to green:

  • TestFitResourceQuotaNonNvidia (mlu and dcu subcases)
  • TestFitResourceQuotaCountsEveryDevice
  • TestFitResourceQuotaAscendMemoryFactor

Which issue(s) this PR fixes:
none filed, this is a master CI regression

Special notes for your reviewer:
test-only, no production code touched. go test ./pkg/scheduler/... passes locally. #2313 was mine, so this is cleaning up after it.

AI assistance disclosure:
I used AI assistance (Claude Code) to bisect which merge combination broke master and to confirm the fix. I read and ran the tests myself.

Does this PR introduce a user-facing change?:
NONE

Summary by CodeRabbit

  • Tests
    • Updated quota test fixtures to explicitly mark Cambricon, Hygon, multi-MLU, and Ascend limits as active.
    • Improved test coverage reliability for scheduler webhook quota scenarios.

Project-HAMi#2313 made FitQuota gate on LimitSet instead of Limit != 0, so an explicit
ResourceQuota of 0 is honored as a hard block. The quota tests added in Project-HAMi#2347
build device.Quota values directly with only Limit set, so after Project-HAMi#2313 those
limits read as not-configured and the over-quota cases were admitted instead of
denied. AddQuota sets LimitSet in the real path; set it in the fixtures too.

This is why master currently fails TestFitResourceQuotaNonNvidia,
TestFitResourceQuotaCountsEveryDevice and TestFitResourceQuotaAscendMemoryFactor:

Signed-off-by: Shridhar Panigrahi <198173519+veyron-kairo@users.noreply.github.com>
Project-HAMi#2347 and Project-HAMi#2313 each passed CI on their own base and only conflict once combined.
@hami-robot hami-robot Bot added kind/bug Something isn't working dco-signoff: yes labels Aug 6, 2026
@hami-robot
hami-robot Bot requested review from chaunceyjiang and wawa0210 August 6, 2026 13:52
@hami-robot

hami-robot Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: veyron-kairo
Once this PR has been reviewed and has the lgtm label, please assign archlitchi for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@hami-robot hami-robot Bot added the size/S label Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ee5716d9-0c62-47f5-aaed-b59f49ae6405

📥 Commits

Reviewing files that changed from the base of the PR and between 87d9795 and b458503.

📒 Files selected for processing (1)
  • pkg/scheduler/webhook_test.go

📝 Walkthrough

Walkthrough

The webhook test fixtures now set LimitSet: true for Cambricon, Hygon, multi-MLU, and Ascend quota limits.

Changes

Quota fixture updates

Layer / File(s) Summary
Activate quota limit flags
pkg/scheduler/webhook_test.go
Cambricon, Hygon, multi-MLU, and Ascend quota fixtures now explicitly mark their limits as configured.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

Suggested reviewers: dsfans2014

Poem

A rabbit hops through quota rows,
And marks each active limit.
Cambricon, Hygon, Ascend too,
Multi-MLU joins in it.
Tests now know which bounds are true.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: setting LimitSet on quota fixtures to fix failing tests, matching the referenced issue #2347.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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.

@coderabbitai
coderabbitai Bot requested a review from DSFans2014 August 6, 2026 13:53
@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
unittests 63.39% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@archlitchi

Copy link
Copy Markdown
Member

Already fixed

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.

2 participants