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

integration: fix bug in for loop, make it break properly #11153

Merged
merged 1 commit into from Sep 17, 2019

Conversation

beautytiger
Copy link

The break statement should break the outer for loop, or it will run forever.

Please read https://github.com/etcd-io/etcd/blob/master/CONTRIBUTING.md#contribution-flow.

for {
select {
case <-time.After(500 * time.Millisecond):
case <-timeout:
t.Errorf("failed all attempts to promote learner member, last error: %v", err)
break
break promLoop
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch! Can we use t.Fatalf here?

Copy link
Author

Choose a reason for hiding this comment

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

Chnage to t.Fataf, in this case, the break is no need anymore

@jingyih
Copy link
Contributor

jingyih commented Sep 16, 2019

Also, please change commit title to use format <package>:<description>, something like: "clientv3: fix bug in for loop". Otherwise the CI checker will complain.

@beautytiger beautytiger changed the title fix bug in for loop, make it break properly integration: fix bug in for loop, make it break properly Sep 17, 2019
Copy link
Contributor

@jingyih jingyih left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@jingyih jingyih merged commit a546864 into etcd-io:master Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants