Skip to content

Commit

Permalink
Use a more precise clock on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
pquentin committed May 16, 2024
1 parent d3e89c4 commit 84015e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/with_dummyserver/test_https.py
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ def test_http2_probe_no_result_in_ssl_error(self) -> None:
urllib3.http2.extract_from_urllib3()

def test_http2_probe_blocked_per_thread(self) -> None:
state, current_thread, last_action = None, None, time.monotonic()
state, current_thread, last_action = None, None, time.perf_counter()

def connect_callback(label: str, thread_id: int, **kwargs: typing.Any) -> None:
nonlocal state, current_thread, last_action
Expand All @@ -1052,8 +1052,8 @@ def connect_callback(label: str, thread_id: int, **kwargs: typing.Any) -> None:

# Since we're trying to connect to TARPIST_HOST, all connections will
# fail, but they should be tried one after the other
now = time.monotonic()
assert now > last_action
now = time.perf_counter()
assert now >= last_action
last_action = now

if label == "before connect":
Expand Down

0 comments on commit 84015e4

Please sign in to comment.