Skip to content

Commit 0d9a2a8

Browse files
committed
Replace more timeouts
1 parent e32962e commit 0d9a2a8

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ def _recv_packet(
341341
self,
342342
*,
343343
predicate: Optional[Callable[[ProtocolMessage], bool]] = None,
344-
timeout: Optional[float] = None,
344+
timeout: Optional[float] = DEFAULT_TIMEOUT,
345345
) -> Optional[ProtocolMessage]:
346346
"""Processes received packets from the adapter.
347347
Updates the DebugCommunication stateful properties based on the received
@@ -565,7 +565,7 @@ def predicate(p: ProtocolMessage):
565565

566566
return cast(
567567
Optional[Event],
568-
self._recv_packet(predicate=predicate, timeout=DEFAULT_TIMEOUT),
568+
self._recv_packet(predicate=predicate),
569569
)
570570

571571
def wait_for_stopped(self) -> Optional[List[Event]]:
@@ -1609,7 +1609,7 @@ def terminate(self):
16091609
# new messages will arrive and it should shutdown on its
16101610
# own.
16111611
process.stdin.close()
1612-
process.wait(timeout=20)
1612+
process.wait(timeout=DEFAULT_TIMEOUT)
16131613
except subprocess.TimeoutExpired:
16141614
process.kill()
16151615
process.wait()

lldb/test/API/tools/lldb-dap/cancel/TestDAP_cancel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def test_pending_request(self):
4646

4747
# Use a relatively short timeout since this is only to ensure the
4848
# following request is queued.
49-
blocking_seq = self.async_blocking_request(duration=1.0)
49+
blocking_seq = self.async_blocking_request(duration=self.DEFAULT_TIMEOUT / 10)
5050
# Use a longer timeout to ensure we catch if the request was interrupted
5151
# properly.
5252
pending_seq = self.async_blocking_request(duration=self.DEFAULT_TIMEOUT / 2)

lldb/test/API/tools/lldb-dap/io/TestDAP_io.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def test_eof_immediately(self):
4444
"""
4545
process = self.launch()
4646
process.stdin.close()
47-
self.assertEqual(process.wait(timeout=5.0), EXIT_SUCCESS)
47+
self.assertEqual(process.wait(timeout=self.DEFAULT_TIMEOUT), EXIT_SUCCESS)
4848

4949
def test_invalid_header(self):
5050
"""
@@ -54,7 +54,7 @@ def test_invalid_header(self):
5454
process = self.launch()
5555
process.stdin.write(b"not the correct message header")
5656
process.stdin.close()
57-
self.assertEqual(process.wait(timeout=5.0), EXIT_FAILURE)
57+
self.assertEqual(process.wait(timeout=self.DEFAULT_TIMEOUT), EXIT_FAILURE)
5858

5959
def test_partial_header(self):
6060
"""
@@ -64,7 +64,7 @@ def test_partial_header(self):
6464
process = self.launch()
6565
process.stdin.write(b"Content-Length: ")
6666
process.stdin.close()
67-
self.assertEqual(process.wait(timeout=5.0), EXIT_FAILURE)
67+
self.assertEqual(process.wait(timeout=self.DEFAULT_TIMEOUT), EXIT_FAILURE)
6868

6969
def test_incorrect_content_length(self):
7070
"""
@@ -74,7 +74,7 @@ def test_incorrect_content_length(self):
7474
process = self.launch()
7575
process.stdin.write(b"Content-Length: abc")
7676
process.stdin.close()
77-
self.assertEqual(process.wait(timeout=5.0), EXIT_FAILURE)
77+
self.assertEqual(process.wait(timeout=self.DEFAULT_TIMEOUT), EXIT_FAILURE)
7878

7979
def test_partial_content_length(self):
8080
"""
@@ -84,4 +84,4 @@ def test_partial_content_length(self):
8484
process = self.launch()
8585
process.stdin.write(b"Content-Length: 10\r\n\r\n{")
8686
process.stdin.close()
87-
self.assertEqual(process.wait(timeout=5.0), EXIT_FAILURE)
87+
self.assertEqual(process.wait(timeout=self.DEFAULT_TIMEOUT), EXIT_FAILURE)

0 commit comments

Comments
 (0)