Skip to content

Commit dcce1e7

Browse files
committed
test: resolve timing flake in test_bidi.py by adding tolerance to wait time assertion
1 parent a1341f0 commit dcce1e7

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

packages/google-api-core/tests/unit/test_bidi.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
except ImportError: # pragma: NO COVER
3232
pytest.skip("No GRPC", allow_module_level=True)
3333

34-
from google.api_core import bidi
35-
from google.api_core import exceptions
34+
from google.api_core import bidi, exceptions
3635

3736

3837
class Test_RequestQueueGenerator(object):
@@ -195,7 +194,7 @@ def test_delays_entry_attempts_above_threshold(self):
195194
# (NOTE: not using assert all(...), b/c the coverage check would complain)
196195
for i, entry in enumerate(entries):
197196
if i != 3:
198-
assert entry["reported_wait"] == 0.0
197+
assert entry["reported_wait"] < 0.01
199198

200199
# The delayed entry is expected to have been delayed for a significant
201200
# chunk of the full second, and the actual and reported delay times

0 commit comments

Comments
 (0)