Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix pdb collection testing occasional failure #5382

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

chaosi-zju
Copy link
Member

@chaosi-zju chaosi-zju commented Aug 15, 2024

What type of PR is this?

/kind failing-test

What this PR does / why we need it:

these days, the e2e case [pdb status collection testing] often failed, such as:

https://github.com/karmada-io/karmada/actions/runs/10401933004/job/28805568396?pr=5378
https://github.com/karmada-io/karmada/actions/runs/10401933004/job/28811015421?pr=5378

  1. work status of deploment/nginx in member1:
"manifestStatuses": [
      {
        "identifier": {
          "ordinal": 0,
          "group": "apps",
          "version": "v1",
          "kind": "Deployment",
          "resource": "",
          "namespace": "karmadatest-tlftr",
          "name": "poddisruptionbudget-m472d"
        },
        "status": {
          "availableReplicas": 3,
          "generation": 1,
          "observedGeneration": 1,
          "readyReplicas": 3,
          "replicas": 3,
          "resourceTemplateGeneration": 2,
          "updatedReplicas": 3
        },
        "health": "Healthy"
      }
    ]
  1. work status of PodDisruptionBudget/nginx in member1:
"manifestStatuses": [
      {
        "identifier": {
          "ordinal": 0,
          "group": "policy",
          "version": "v1",
          "kind": "PodDisruptionBudget",
          "resource": "",
          "namespace": "karmadatest-tlftr",
          "name": "poddisruptionbudget-m472d"
        },
        "status": {
          "currentHealthy": 6,
          "desiredHealthy": 3,
          "disruptionsAllowed": 3,
          "expectedPods": 6
        },
        "health": "Healthy"
      }

so, the pdb selected more than 3 pods by app:nginx, it has selected another 3 pods created by other e2e cases.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@karmada-bot karmada-bot added the kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. label Aug 15, 2024
@chaosi-zju
Copy link
Member Author

@karmada-bot karmada-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 15, 2024
@zhzhuang-zju
Copy link
Contributor

/assign

@codecov-commenter
Copy link

codecov-commenter commented Aug 15, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 29.35%. Comparing base (cd99897) to head (e7e06ce).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5382      +/-   ##
==========================================
- Coverage   29.35%   29.35%   -0.01%     
==========================================
  Files         632      632              
  Lines       43862    43862              
==========================================
- Hits        12877    12874       -3     
- Misses      30050    30053       +3     
  Partials      935      935              
Flag Coverage Δ
unittests 29.35% <ø> (-0.01%) ⬇️

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.

Copy link
Contributor

@zhzhuang-zju zhzhuang-zju left a comment

Choose a reason for hiding this comment

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

thanks, looks like the issue is a conflict with other e2e tests again
others LGMT

test/e2e/resource_test.go Show resolved Hide resolved
@XiShanYongYe-Chang
Copy link
Member

Can you explain a little bit why the occasional error occurs?

@chaosi-zju
Copy link
Member Author

Can you explain a little bit why the occasional error occurs?

done


deployment = testhelper.NewDeployment(pdbNamespace, deploymentName)
pdb = testhelper.NewPodDisruptionBudget(pdbNamespace, pdbName, intstr.FromString("50%"))
deployment.SetLabels(matchLabels)
Copy link
Member Author

@chaosi-zju chaosi-zju Aug 15, 2024

Choose a reason for hiding this comment

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

bug found, it should be:

Suggested change
deployment.SetLabels(matchLabels)
deployment.Spec.Selector.MatchLabels = matchLabels
deployment.Spec.Template.Labels = matchLabels

Signed-off-by: chaosi-zju <chaosi@zju.edu.cn>
@chaosi-zju
Copy link
Member Author

/retest

@chaosi-zju
Copy link
Member Author

It is s ready to move forward~

@zhzhuang-zju
Copy link
Contributor

/lgtm
ask @XiShanYongYe-Chang to take another look

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 16, 2024
Copy link
Member

@XiShanYongYe-Chang XiShanYongYe-Chang left a comment

Choose a reason for hiding this comment

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

Thanks~
/approve

@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: XiShanYongYe-Chang

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

The pull request process is described here

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

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 16, 2024
@karmada-bot karmada-bot merged commit 4ac6285 into karmada-io:master Aug 16, 2024
12 checks passed
@RainbowMango RainbowMango added this to the v1.11 milestone Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants