Skip to content

Commit cf18c38

Browse files
davidsoergelnfelt
authored andcommitted
Fix spuriously failing grpc test
1 parent 995b88b commit cf18c38

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tensorboard/util/grpc_util_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ def handler(request, context):
129129

130130
def test_call_with_retries_includes_version_metadata(self):
131131
def digest(s):
132-
"""Hashes a string into a 32-bit integer."""
133-
return int(hashlib.sha256(s.encode("utf-8")).hexdigest(), 16) & 0xffffffff
132+
"""Hashes a string into a positive 32-bit signed integer."""
133+
return int(hashlib.sha256(s.encode("utf-8")).hexdigest(), 16) & 0x7fffffff
134134
def handler(request, context):
135135
metadata = context.invocation_metadata()
136136
client_version = grpc_util.extract_version(metadata)

0 commit comments

Comments
 (0)