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

end2end: update sendVotes to avoid infinite for loop #1066

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

mariajdab
Copy link
Contributor

Currently in the approach for send a batch of votes sendVotes is possible to experiment a infinite for loop, due in some cases the error is handled with a log using log.Warn(err) or it is just ignored and continue, in order to prevent the infinite loop a couple of variables was added to count each of those errors and if the count reach the max count allowed, that error is added to the slice of error returned by the method.

Also, currently the errs returned by the sendVotes is not been checked in each test, it was also included in this change.

And in the other hand overwriteVote was simplified to not use sendVotes as intermediary method, instead just use api.Vote and check the error once.

@mariajdab mariajdab requested a review from altergui July 29, 2023 02:16
@p4u
Copy link
Member

p4u commented Aug 1, 2023

@altergui please

cmd/end2endtest/helpers.go Outdated Show resolved Hide resolved
cmd/end2endtest/helpers.go Outdated Show resolved Hide resolved
cmd/end2endtest/helpers.go Show resolved Hide resolved
cmd/end2endtest/helpers.go Outdated Show resolved Hide resolved
cmd/end2endtest/helpers.go Show resolved Hide resolved
cmd/end2endtest/helpers.go Outdated Show resolved Hide resolved
cmd/end2endtest/helpers.go Outdated Show resolved Hide resolved
@mariajdab mariajdab force-pushed the end2endtest/check-errors-from-sendVotes branch 2 times, most recently from 83430f5 to 99cea63 Compare August 9, 2023 02:46
@mariajdab mariajdab requested a review from altergui August 9, 2023 02:47
…hen retry count reached the max allowed

check the errs in each test that calls sendVotes
@mariajdab mariajdab force-pushed the end2endtest/check-errors-from-sendVotes branch from 99cea63 to cd77535 Compare September 5, 2023 10:54
@mariajdab
Copy link
Contributor Author

Ready for re-review @altergui

Copy link
Contributor

@altergui altergui left a comment

Choose a reason for hiding this comment

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

LGTM

@mariajdab mariajdab merged commit 0e0af74 into main Sep 6, 2023
9 checks passed
@mariajdab mariajdab deleted the end2endtest/check-errors-from-sendVotes branch September 6, 2023 10:23
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.

3 participants