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 wait logic in TestWaitForPodSucceeded #3414

Merged
merged 1 commit into from
Dec 20, 2019

Conversation

balopat
Copy link
Contributor

@balopat balopat commented Dec 20, 2019

No description provided.

Copy link
Contributor

@dgageot dgageot left a comment

Choose a reason for hiding this comment

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

By reading the changes, I don't really understand how it works better but I trust you.

@codecov
Copy link

codecov bot commented Dec 20, 2019

Codecov Report

Merging #3414 into master will not change coverage.
The diff coverage is n/a.

@balopat
Copy link
Contributor Author

balopat commented Dec 20, 2019

The logic is this for each test:

main go routine: modify pod state -> sleep(update_time) -> modify pod state -> sleep(update_time) -> ...

waitfor pod go routine: wait for (pod to be in <state>) or timeout after (timeout_time)

if (update_time == timeout_time) (like before), then this will be flaky with a high probability of a race. It's like a "super impatient client that waits for the pod to get into a phase". Given in the first two test cases the desired update happens after the first sleep. Not sure how this ever worked consistently.

if update_time << timeout_time, this fixes it, it makes the "client more patient".

The third test case is a bit superfluous, we shouldn't need to "update" the state 5 times to the same thing, one initial update should be sufficient and the "client" will timeout anyway.

@balopat balopat merged commit 923cdb6 into GoogleContainerTools:master Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants