Skip to content

Commit 086297b

Browse files
authored
Merge pull request grpc#22290 from lidizheng/fix-time-remaining
[Aio] Fix the test_time_remaining test
2 parents 35ee039 + 2c783d7 commit 086297b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/python/grpcio_tests/tests_aio/unit/call_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -457,16 +457,16 @@ async def test_time_remaining(self):
457457

458458
# Should be around the same as the timeout
459459
remained_time = call.time_remaining()
460-
self.assertGreater(remained_time, test_constants.SHORT_TIMEOUT * 3 // 2)
461-
self.assertLess(remained_time, test_constants.SHORT_TIMEOUT * 2)
460+
self.assertGreater(remained_time, test_constants.SHORT_TIMEOUT * 3 / 2)
461+
self.assertLess(remained_time, test_constants.SHORT_TIMEOUT * 5 / 2)
462462

463463
response = await call.read()
464464
self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
465465

466466
# Should be around the timeout minus a unit of wait time
467467
remained_time = call.time_remaining()
468-
self.assertGreater(remained_time, test_constants.SHORT_TIMEOUT // 2)
469-
self.assertLess(remained_time, test_constants.SHORT_TIMEOUT * 3 // 2)
468+
self.assertGreater(remained_time, test_constants.SHORT_TIMEOUT / 2)
469+
self.assertLess(remained_time, test_constants.SHORT_TIMEOUT * 3 / 2)
470470

471471
self.assertEqual(grpc.StatusCode.OK, await call.code())
472472

0 commit comments

Comments
 (0)