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: add info log for bidi streaming pull ack_deadline requests #692

Merged
merged 4 commits into from
May 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,9 @@ def heartbeat(self) -> bool:
request = gapic_types.StreamingPullRequest(
stream_ack_deadline_seconds=self.ack_deadline
)
_LOGGER.info(
"Sending new ack_deadline of %d seconds.", self.ack_deadline
)
else:
request = gapic_types.StreamingPullRequest()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,8 @@ def test_heartbeat_inactive():
assert not result


def test_heartbeat_stream_ack_deadline_seconds():
def test_heartbeat_stream_ack_deadline_seconds(caplog):
caplog.set_level(logging.INFO)
manager = make_manager()
manager._rpc = mock.create_autospec(bidi.BidiRpc, instance=True)
manager._rpc.is_active = True
Expand All @@ -1050,6 +1051,7 @@ def test_heartbeat_stream_ack_deadline_seconds():
assert result
# Set to false after a send is initiated.
assert not manager._send_new_ack_deadline
assert "Sending new ack_deadline of 10 seconds." in caplog.text


@mock.patch("google.api_core.bidi.ResumableBidiRpc", autospec=True)
Expand Down