Skip to content

test(e2e): add ServiceQuality-driven scale down prioritization test#307

Open
arnavgogia20 wants to merge 4 commits intoopenkruise:masterfrom
arnavgogia20:test/service-quality-scale-down
Open

test(e2e): add ServiceQuality-driven scale down prioritization test#307
arnavgogia20 wants to merge 4 commits intoopenkruise:masterfrom
arnavgogia20:test/service-quality-scale-down

Conversation

@arnavgogia20
Copy link

Description

This PR adds an end-to-end test to validate ServiceQuality-driven scale-down behavior
for GameServerSets.

The test ensures that replicas marked with opsState: WaitToBeDeleted are prioritized
for deletion when scaling down, instead of following the default ordinal-based strategy.

Changes Made

  • Added RestConfig to the E2E framework to support SPDY-based exec operations
  • Introduced WaitForPodRunning helper to ensure deterministic exec behavior
  • Implemented a new E2E test that:
    • Deploys a GameServerSet with 3 replicas
    • Applies a ServiceQuality using a file-existence check
    • Triggers WaitToBeDeleted on a specific replica via exec
    • Scales down the GameServerSet
    • Verifies the prioritized replica is deleted first
  • Registered the test in the E2E test suite

Testing

  • Verified locally on a Kubernetes cluster
  • Test runs as part of the standard E2E suite

Related Issue

Fixes #292

Signed-off-by: arnavgogia20 <arnavgogia404@gmail.com>
@kruise-bot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign furykerry for approval by writing /assign @furykerry in a comment. 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

@kruise-bot
Copy link

Welcome @arnavgogia20! It looks like this is your first PR to openkruise/kruise-game 🎉

- Reconcile go.mod and go.sum after adding E2E test dependencies
- Ensure module files are consistent via go mod tidy
- No functional changes beyond conflict resolution

Signed-off-by: arnavgogia20 <arnavgogia404@gmail.com>
@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 40.30%. Comparing base (aea10ee) to head (9f48e18).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #307   +/-   ##
=======================================
  Coverage   40.30%   40.30%           
=======================================
  Files         112      112           
  Lines       12499    12499           
=======================================
  Hits         5038     5038           
  Misses       7055     7055           
  Partials      406      406           
Flag Coverage Δ
unittests 40.30% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

- Increase WaitForPodRunning timeout to 3m
- Use /bin/sh -c for exec commands to ensure execution
- Add file existence verification step
- Capture and report exec stdout/stderr on failure

Signed-off-by: arnavgogia20 <arnavgogia404@gmail.com>
- Set ServiceQuality probe PeriodSeconds to 1 to speed up test execution
- Add explicit assertion messages to aid debugging in CI

Signed-off-by: arnavgogia20 <arnavgogia404@gmail.com>
@arnavgogia20
Copy link
Author

Hii @furykerry @zmberg , the PR is ready with all the checks successful, please consider reviewing it, thankyouu

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.

E2E: ServiceQuality-driven scale down prioritizes WaitToBeDeleted

2 participants

Comments