fix(test/setupTestSandbox): wait until initial objects are propagated to informers#1878
Conversation
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: a7i The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/override pull-descheduler-verify-master |
There was a problem hiding this comment.
Pull request overview
This PR updates the kube client sandbox test setup to wait for initial objects to reach the sandbox’s fake informer indexers before tests proceed, reducing races in sandbox-related tests.
Changes:
- Adds polling in
setupTestSandboxto confirm initial objects are visible in the fake indexer. - Adds
metaimport for object metadata logging during propagation waits.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| exists, err := sandbox.hasRuntimeObjectInIndexer(obj) | ||
| if err != nil { | ||
| t.Logf("Error checking if object propagated to fake indexer: %v", err) | ||
| return false, nil |
| // Wait for initial objects to propagate from real client to fake client via event handlers. | ||
| for _, obj := range initialObjects { |
| // Wait for initial objects to propagate from real client to fake client via event handlers. | ||
| for _, obj := range initialObjects { | ||
| if err := wait.PollUntilContextTimeout(ctx, 10*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) { | ||
| exists, err := sandbox.hasRuntimeObjectInIndexer(obj) |
2673e34 to
66918dc
Compare
|
New changes are detected. LGTM label has been removed. |
|
/override pull-descheduler-verify-master |
|
@ingvagabund: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions 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. I understand the commands that are listed here. |
Description
ssia
Checklist
Please ensure your pull request meets the following criteria before submitting
for review, these items will be used by reviewers to assess the quality and
completeness of your changes: