Skip to content

Fix dynamicresources_test flakiness #133321

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

Merged
merged 1 commit into from
Aug 10, 2025
Merged

Conversation

yliaog
Copy link
Contributor

@yliaog yliaog commented Jul 30, 2025

1/ added retries to AssumeClaimAfterAPICall for the object which is not present in the cache (dynamicresources.go)
2/ added wait for informer in postFilter verification test (dynamicresources_test.go).
3/ modified the assume cache verification to not error out as long as
the expected claim is in the cache, no matter its latest and api object
are different or not. (dynamicresources_test.go)
4/ fixed nil panic as seen from https://prow.k8s.io/view/gs/kubernetes-ci-logs/pr-logs/pull/133321/pull-kubernetes-integration/1952472629470302208

What type of PR is this?

/kind bug

What this PR does / why we need it:

Which issue(s) this PR is related to:

#133302

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jul 30, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Jul 30, 2025
@k8s-ci-robot k8s-ci-robot requested review from bart0sh and kerthcet July 30, 2025 18:19
@k8s-ci-robot k8s-ci-robot added sig/node Categorizes an issue or PR as relevant to SIG Node. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. wg/device-management Categorizes an issue or PR as relevant to WG Device Management. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 30, 2025
@yliaog
Copy link
Contributor Author

yliaog commented Jul 30, 2025

with this PR, the extended resources tests all pass with zero flake.

$ stress ./dynamicresources.test -test.run TestPlugin
5s: 105 runs so far, 0 failures, 64 active
10s: 249 runs so far, 0 failures, 64 active
15s: 373 runs so far, 0 failures, 64 active
20s: 503 runs so far, 0 failures, 64 active
25s: 645 runs so far, 0 failures, 64 active
30s: 807 runs so far, 0 failures, 64 active
35s: 934 runs so far, 0 failures, 64 active
40s: 1076 runs so far, 0 failures, 64 active
45s: 1214 runs so far, 0 failures, 64 active
50s: 1367 runs so far, 0 failures, 64 active
55s: 1509 runs so far, 0 failures, 64 active

@yliaog
Copy link
Contributor Author

yliaog commented Jul 30, 2025

/assign @pohly
/cc @johnbelamaric

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 30, 2025
@yliaog
Copy link
Contributor Author

yliaog commented Jul 30, 2025

/retest

@yliaog yliaog force-pushed the assumecache branch 2 times, most recently from 3ce5e25 to f0c8bad Compare July 31, 2025 01:43
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 6, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: c819ef4d149340e7f9599ea340d1f770130ffd25

@macsko
Copy link
Member

macsko commented Aug 6, 2025

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: macsko, yliaog

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 6, 2025
pollErr := wait.PollUntilContextTimeout(ctx, 1*time.Second, time.Duration(AssumeExtendedResourceTimeoutDefaultSeconds)*time.Second, true,
func(ctx context.Context) (bool, error) {
if err := pl.draManager.ResourceClaims().AssumeClaimAfterAPICall(claim); err != nil {
logger.V(5).Info("Claim not stored in assume cache", "claim", klog.KObj(claim), "err", err)
Copy link
Member

Choose a reason for hiding this comment

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

nit: You could consider moving the log below, i.e.

if errors.Is(err, assumecache.ErrNotFound) {
	return false, nil
}
logger.V(5).Info("Claim not stored in assume cache", "claim", klog.KObj(claim), "err", err)

not to spam the console with this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, moved. PTAL

…ot present in the cache (dynamicresources.go)

2/ modified the assume cache verification to not error out as long as
the expected claim is in the cache, no matter its latest and api object
are different or not. (dynamicresources_test.go).
3/ fixed nil panic as seen from https://prow.k8s.io/view/gs/kubernetes-ci-logs/pr-logs/pull/133321/pull-kubernetes-integration/1952472629470302208
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 6, 2025
@k8s-ci-robot k8s-ci-robot requested review from macsko and pohly August 6, 2025 07:18
@macsko
Copy link
Member

macsko commented Aug 6, 2025

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 6, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 94fa76bdaf00d908919cbe25ecbd555878d4111d

@yliaog
Copy link
Contributor Author

yliaog commented Aug 6, 2025

/retest

@macsko
Copy link
Member

macsko commented Aug 6, 2025

@kubernetes/sig-release-leads
It's a fix for release blocker. We need a milestone to be applied

@macsko
Copy link
Member

macsko commented Aug 6, 2025

Or @kubernetes/release-team-leads

@Vyom-Yadav
Copy link
Member

/milestone v1.34

@liggitt
Copy link
Member

liggitt commented Aug 9, 2025

/hold

This PR is still flaking the unit tests in the package it is trying to stabilize:

https://prow.k8s.io/view/gs/kubernetes-ci-logs/pr-logs/pull/133321/pull-kubernetes-unit/1954212504481566720

. Please run with -race and stress locally to show this is giving us a flake free test before merge

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 9, 2025
@yliaog
Copy link
Contributor Author

yliaog commented Aug 9, 2025

/retest

@yliaog
Copy link
Contributor Author

yliaog commented Aug 9, 2025

The failed test below is about DRADeviceTaints feature, not about DRAExtendedResource feature this PR is focusing on fixing.
{Failed === RUN TestPlugin/tainted-device-disabled/prebind

Similarly, the e2e test failure is also not related to DRAExtendedResource feature.
Kubernetes e2e suite: [It] [sig-node] [DRA] control plane [ConformanceCandidate] with node-local resources uses all resources

I think it's better for feature owners who are more familar with the feature, and test to look into these flakiness.

@liggitt
Copy link
Member

liggitt commented Aug 9, 2025

Ok, feel free to unhold if you are sure the flaking test is distinct from the issue this PR is fixing, and that the flake isn't caused by the changes in this PR

@yliaog
Copy link
Contributor Author

yliaog commented Aug 10, 2025

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 10, 2025
@k8s-ci-robot k8s-ci-robot merged commit b4b973c into kubernetes:master Aug 10, 2025
19 checks passed
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. wg/device-management Categorizes an issue or PR as relevant to WG Device Management.
Projects
Status: 🆕 New
Status: Done
Development

Successfully merging this pull request may close these issues.

7 participants