mirror of
https://github.com/razzant/ouroboros.git
synced 2026-10-03 04:07:04 +00:00
test: align all settings writer timeout oracles with clock resolution
This commit is contained in:
parent
96d62a081f
commit
4e5ea132ff
1 changed files with 3 additions and 1 deletions
|
|
@ -133,7 +133,9 @@ def test_the_initiating_writer_returns_within_the_same_bound(monkeypatch):
|
|||
_run_settings_writer(wedged_writer, SimpleNamespace(), {})
|
||||
)
|
||||
elapsed = time.monotonic() - started
|
||||
assert 2 * 0.2 <= elapsed < 5, elapsed # exactly the 2x bound, then the typed answer
|
||||
# asyncio timers may fire up to one monotonic-clock resolution early.
|
||||
resolution = time.get_clock_info("monotonic").resolution
|
||||
assert 2 * 0.2 - resolution <= elapsed < 5, elapsed
|
||||
assert not finished.is_set(), "the response must not wait for the wedged body"
|
||||
release.set()
|
||||
assert finished.wait(10), "the abandoned body must still run to completion in its thread"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue