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 pop timer crash #720

Merged
merged 3 commits into from
Feb 15, 2021
Merged

Conversation

Askaholic
Copy link
Collaborator

@Askaholic Askaholic commented Feb 13, 2021

It was not directly the fault of the pop timer, but rather an exception that could sometimes occur during random newbie matching. CombinedSearch objects would return a list for failed_matching_attempts instead of an integer. This has been fixed and I made sure to add an integration test that covers newbie matching with two solo queue-ers who were placed together by the team creation code. I also wrapped the pop timer loop contents in a try block, since this sort of error should really only be failing the current matching attempt, and not crashing the entire timer loop.

Test was flaky due to expensive autospecing
def failed_matching_attempts(self) -> List[int]:
"""Used for logging so returning a different type here is fine"""
return [search.failed_matching_attempts for search in self.searches]
def failed_matching_attempts(self) -> int:
Copy link
Member

Choose a reason for hiding this comment

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

may nbr_of_failed_matching_attempts is more descriptive (and would have made this more obvious).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think the naming is a problem, but rather that returning a list here was just a bad idea on my part :P. At the time it wasn't used and I wasn't sure what to return here. I'm gonna add it to the unit tests now.

Copy link
Contributor

@0x647262 0x647262 left a comment

Choose a reason for hiding this comment

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

LGTM!

@Askaholic Askaholic merged commit d2265dc into FAForever:develop Feb 15, 2021
@Askaholic Askaholic deleted the fix-pop-timer-crash branch February 15, 2021 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants