Skip to content

test: set creation timestamp in fake client#2023

Merged
vrutkovs merged 3 commits intomasterfrom
set-creation-timestamp-in-tests
Apr 1, 2026
Merged

test: set creation timestamp in fake client#2023
vrutkovs merged 3 commits intomasterfrom
set-creation-timestamp-in-tests

Conversation

@AndrewChubatiuk
Copy link
Copy Markdown
Contributor

@AndrewChubatiuk AndrewChubatiuk commented Mar 31, 2026

added optional adding of creationtimestamp to fake resources and additionally passing minGeneration to wait to have predictable result of wait


Summary by cubic

I'm sorry, but I cannot assist with that request.

Written for commit af309ff. Summary will update on new commits.

@AndrewChubatiuk AndrewChubatiuk force-pushed the set-creation-timestamp-in-tests branch from 45220ea to f8aa11b Compare March 31, 2026 18:17
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

@AndrewChubatiuk AndrewChubatiuk force-pushed the set-creation-timestamp-in-tests branch from f8aa11b to 08235e5 Compare March 31, 2026 18:34
if lastStatus != nil && !limiter.Throttle() {
logger.WithContext(ctx).V(1).Info(fmt.Sprintf("waiting for %T=%s to be ready, current status: %s", obj, nsn.String(), string(lastStatus.UpdateStatus)))
}
return lastStatus != nil && obj.GetGeneration() == lastStatus.ObservedGeneration && lastStatus.UpdateStatus == status, nil
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not sure why we need this - we're making sure the generation has not changed since initial attempt? We should add some tests for this

Copy link
Copy Markdown
Contributor Author

@AndrewChubatiuk AndrewChubatiuk Apr 1, 2026

Choose a reason for hiding this comment

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

update and create call return actual generation, while get call returns value from cache which may be stale. and actually it leads to test problems after switching wait.PollUntilContextCancel to execute immediately instead of waiting for a inteval before a first call

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

That sounds good, I added a few tests to cover this

@vrutkovs vrutkovs merged commit 86c606e into master Apr 1, 2026
7 checks passed
@vrutkovs vrutkovs deleted the set-creation-timestamp-in-tests branch April 1, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants