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

Add GoRoutineMap.Wait method. #25399

Merged
merged 1 commit into from
May 13, 2016

Conversation

jsafrane
Copy link
Member

It's useful for testing - code under tests creates an operation and the test needs to wait until the operation finishes before evaluating results.

It's useful for testing - code under tests creates an operation and my test
needs to wait until the operation finishes before evaluating results.
@jsafrane jsafrane added release-note-none Denotes a PR that doesn't merit a release note. and removed cla: yes labels May 10, 2016
@jsafrane
Copy link
Member Author

@saad-ali, PTAL

@k8s-github-robot k8s-github-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 10, 2016
@@ -73,4 +80,9 @@ func (grm *goRoutineMap) operationComplete(operationName string) {
grm.Lock()
defer grm.Unlock()
delete(grm.operations, operationName)
grm.wg.Done()
Copy link
Member

Choose a reason for hiding this comment

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

Done() should be called with defer. Defer statements are executed in stack order (last in, first executed), so make sure defer grm.wg.Done() is called after defer grm.Unlock().

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

@jsafrane jsafrane force-pushed the devel/wait-for-operation branch from f70d61f to 6623385 Compare May 11, 2016 08:04
@jsafrane
Copy link
Member Author

Fixed review remarks and pushed. Thanks for the review!

@k8s-bot
Copy link

k8s-bot commented May 11, 2016

GCE e2e build/test passed for commit 6623385.

@saad-ali saad-ali added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 11, 2016
@j3ffml j3ffml merged commit 3e83de8 into kubernetes:master May 13, 2016
@jsafrane jsafrane deleted the devel/wait-for-operation branch August 19, 2016 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants