Skip to content

Commit 2748d80

Browse files
committed
chore: use monotonic time
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
1 parent 4073429 commit 2748d80

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

tests/integration/fee_estimate_query_e2e_test.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import annotations
22

3-
import datetime
43
import time
54

65
import pytest
@@ -33,13 +32,13 @@ def wait_for_fee_estimation_service_ready(env):
3332
if _fee_estimation_error:
3433
raise _fee_estimation_error
3534

36-
deadline = datetime.datetime.now() + datetime.timedelta(seconds=600.0)
3735
attempts = 0
3836
last_error = None
3937

40-
print("Waiting for FeeEstimationService to get ready")
38+
print("Waiting for FeeEstimationService to get ready...")
4139

42-
while datetime.datetime.now() < deadline:
40+
deadline = time.monotonic() + 600.0
41+
while time.monotonic() < deadline:
4342
attempts += 1
4443
try:
4544
probe = (
@@ -48,7 +47,7 @@ def wait_for_fee_estimation_service_ready(env):
4847
.add_hbar_transfer(env.operator_id, Hbar(1))
4948
)
5049

51-
(FeeEstimateQuery().set_mode(FeeEstimateMode.INTRINSIC).set_transaction(probe).execute(env.client))
50+
FeeEstimateQuery().set_mode(FeeEstimateMode.INTRINSIC).set_transaction(probe).execute(env.client)
5251

5352
_fee_estimation_ready = True
5453

0 commit comments

Comments
 (0)