-
Notifications
You must be signed in to change notification settings - Fork 28
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
Filling Minor Coverage Gaps #434
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -440,7 +440,8 @@ def async_act_wrapper(self) -> Generator: | |
else: | ||
yield from self.async_act() | ||
except StopIteration: | ||
if self.context.state.period.syncing_up: | ||
if self.context.state.period.syncing_up: # pragma: nocover | ||
# needs to be tested | ||
has_synced_up = yield from self._has_synced_up() | ||
if has_synced_up: | ||
self.context.logger.info("local height == remote; Ending sync...") | ||
|
@@ -676,7 +677,7 @@ def _get_status(self) -> Generator[None, None, HttpMessage]: | |
|
||
def _has_synced_up( | ||
self, | ||
) -> Generator[None, None, bool]: | ||
) -> Generator[None, None, bool]: # pragma: nocover | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we not test this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Writing a separating test for this method will be futile since this is a simple network call. This method will be tested automatically once we figure out a way to fix the issue that I mentioned above. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok |
||
"""Check if agent has completed sync.""" | ||
|
||
for _ in range(_DEFAULT_TX_MAX_ATTEMPTS): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,7 +123,7 @@ def _check_matching_round_consistency( | |
raise ABCIAppInternalError( | ||
f"round {round_cls.round_id} is a final round it shouldn't have any matching behaviours." | ||
) | ||
continue | ||
continue # pragma: nocover | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we not have a test for this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's seems to be an issue with covering |
||
if len(states) == 0: | ||
raise ABCIAppInternalError( | ||
f"round {round_cls.round_id} is not a matching round of any state behaviour" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be a lack of understanding on my side but the generator created from
async_act_wrapper
seems to ignore the yield statements after except statement. It throwsStopIteration
after the code in the try block is executed. Don't confuse it with theStopIteraration
exception thrown by generators inside the try block. What I mean is after the try/except block seems to be working as intended, but the generator should also be yielding afterStopIteration
has been handled since there are yield statements after the exception has been handled. I studied Marco's PR but it didn't get anywhere. I propose we skip this test for a while. Also, there seems to be a lot of issues with the test since the PR for sync mechanism and catchup test has been merged. I'll start digging a bit deep and see if I can figure out the issue.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. I also need to dig in there before commenting. @marcofavorito you should read this :)