Skip to content

Commit 0c179aa

Browse files
authored
[lldb-dap] Increase DAP default timeout (#170890)
DAP tests easily timeout when the computer is under-load. This is easily noticeable if you run the test in a loop a compile llvm. or running the test on slower CI/machines. This affects mostly the `DAP_launch`, `DAP_attach`, `DAP_restart_console` and occasionally `DAP_output` tests. Would lead in the direction of enabling some of the test on windows. ``` File "/Volumes/workspace/Dev/llvm-project/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py", line 1140, in request_launch return self._send_recv(command_dict) File "/Volumes/workspace/Dev/llvm-project/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py", line 548, in _send_recv raise ValueError(f"no response for {request!r}") ValueError: no response for {'command': 'launch', 'type': 'request', 'arguments': {'program': '/Volumes/workspace/Dev/llvm-build/release/lldb-test-build.noindex/tools/lldb-dap/restart/TestDAP_restart_console.test_basic_functionality/a.out', 'initCommands': ['settings clear --all', 'settings set symbols.enable-external-lookup false', 'settings set target.inherit-tcc true', 'settings set target.disable-aslr false', 'settings set target.detach-on-error false', 'settings set target.auto-apply-fixits false', 'settings set plugin.process.gdb-remote.packet-timeout 60', 'settings set symbols.clang-modules-cache-path "/Volumes/workspace/Dev/llvm-build/release/lldb-test-build.noindex/module-cache-lldb"', 'settings set use-color false', 'settings set show-statusline false'], 'console': 'integratedTerminal', 'disableASLR': False, 'enableAutoVariableSummaries': False, 'enableSyntheticChildDebugging': False, 'displayExtendedBacktrace': False}, 'seq': 2} Config=arm64-/Volumes/workspace/Dev/llvm-build/release/bin/clang ---------------------------------------------------------------------- Ran 2 tests in 28.579s ``` Increase the DEFAULT_TIMEOUT from 10 to 50
1 parent fd0fb05 commit 0c179aa

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import time
1616
from typing import (
1717
Any,
18+
Final,
1819
Optional,
1920
Dict,
2021
cast,
@@ -30,7 +31,7 @@
3031

3132
# set timeout based on whether ASAN was enabled or not. Increase
3233
# timeout by a factor of 10 if ASAN is enabled.
33-
DEFAULT_TIMEOUT = 10 * (10 if ("ASAN_OPTIONS" in os.environ) else 1)
34+
DEFAULT_TIMEOUT: Final[float] = 50 * (10 if ("ASAN_OPTIONS" in os.environ) else 1)
3435

3536
# See lldbtest.Base.spawnSubprocess, which should help ensure any processes
3637
# created by the DAP client are terminated correctly when the test ends.
@@ -348,7 +349,7 @@ def _recv_packet(
348349
self,
349350
*,
350351
predicate: Optional[Callable[[ProtocolMessage], bool]] = None,
351-
timeout: Optional[float] = DEFAULT_TIMEOUT,
352+
timeout: float = DEFAULT_TIMEOUT,
352353
) -> Optional[ProtocolMessage]:
353354
"""Processes received packets from the adapter.
354355
Updates the DebugCommunication stateful properties based on the received

lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22
import time
3-
from typing import Optional, Callable, Any, List, Union
3+
from typing import Optional, Callable, Any, List, Union, Final
44
import uuid
55

66
import dap_server
@@ -18,7 +18,7 @@
1818
class DAPTestCaseBase(TestBase):
1919
# set timeout based on whether ASAN was enabled or not. Increase
2020
# timeout by a factor of 10 if ASAN is enabled.
21-
DEFAULT_TIMEOUT = dap_server.DEFAULT_TIMEOUT
21+
DEFAULT_TIMEOUT: Final[float] = dap_server.DEFAULT_TIMEOUT
2222
NO_DEBUG_INFO_TESTCASE = True
2323

2424
def create_debug_adapter(

0 commit comments

Comments
 (0)