From be369810ac0488d2ae726bb079f2e2a1c640fcde Mon Sep 17 00:00:00 2001 From: Lukas Pukenis Date: Thu, 6 Feb 2025 11:26:37 +0200 Subject: [PATCH] Remove timeout when waiting for disconnected event Timeouts can be undeterministic, especially when we use VMs, since they are not as lightweight and might cause delays. In test_event_content_meshnet case we observed constantly that Windows peer fails to receive the event in a timely manner. It is delayed by several seconds sometimes. Why is that it's not entirely clear, and packet capture is not present on Windows at this point. Maybe it's due to same interface being used for libtelio and natlab and TCP retransmissions are to blame for retries that might cause delays. As an easy solution, the timeout is being removed to see if it helps. --- .unreleased/remove-timeout-from-event-testcase | 0 nat-lab/tests/test_events.py | 6 +----- 2 files changed, 1 insertion(+), 5 deletions(-) create mode 100644 .unreleased/remove-timeout-from-event-testcase diff --git a/.unreleased/remove-timeout-from-event-testcase b/.unreleased/remove-timeout-from-event-testcase new file mode 100644 index 000000000..e69de29bb diff --git a/nat-lab/tests/test_events.py b/nat-lab/tests/test_events.py index d442ea963..ca13c99fb 100644 --- a/nat-lab/tests/test_events.py +++ b/nat-lab/tests/test_events.py @@ -186,12 +186,8 @@ async def test_event_content_meshnet( await client_alpha.set_meshnet_config(api.get_meshnet_config(alpha.id)) - # Telio and NatLab both have a sampling rate of 1 second. - # As a result, in the worst case, an event could be delayed by up - # to 2seconds. So 2 second is the minimum amount of time. Still - # the ping might not come within 2 seconds if there's latency. await client_alpha.wait_for_state_peer( - beta.public_key, [NodeState.DISCONNECTED], [PathType.DIRECT], timeout=5 + beta.public_key, [NodeState.DISCONNECTED], [PathType.DIRECT] ) with pytest.raises(asyncio.TimeoutError):