Skip to content

Commit f27cfea

Browse files
authored
[LLDB][Progress-On-Dap] Have indeterminate progress actually send events. (#140162)
Recently, I got a report how a user 'hung', and come to find out it's actually because DAP is checking percentage, and on non-deterministic events, we will effectively never send a progress event to DAP. Here we short circuit and don't view percentages for DAP messages and solely depend on the DAP 250ms throttle, which is probably still too aggressive, but better than no updates.
1 parent 2dd6a8c commit f27cfea

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lldb/test/API/tools/lldb-dap/progress/TestDAP_Progress.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import json
88
import os
99
import time
10+
import re
1011

1112
import lldbdap_testcase
1213

@@ -16,6 +17,7 @@ def verify_progress_events(
1617
self,
1718
expected_title,
1819
expected_message=None,
20+
expected_message_regex=None,
1921
expected_not_in_message=None,
2022
only_verify_first_update=False,
2123
):
@@ -36,6 +38,8 @@ def verify_progress_events(
3638
continue
3739
if expected_message is not None:
3840
self.assertIn(expected_message, message)
41+
if expected_message_regex is not None:
42+
self.assertTrue(re.match(expected_message_regex, message))
3943
if expected_not_in_message is not None:
4044
self.assertNotIn(expected_not_in_message, message)
4145
update_found = True
@@ -81,8 +85,7 @@ def test(self):
8185

8286
self.verify_progress_events(
8387
expected_title="Progress tester: Initial Indeterminate Detail",
84-
expected_message="Step 1",
85-
only_verify_first_update=True,
88+
expected_message_regex=r"Step [0-9]+",
8689
)
8790

8891
# Test no details indeterminate.

lldb/tools/lldb-dap/ProgressEvent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ ProgressEvent::Create(uint64_t progress_id, std::optional<StringRef> message,
8686
bool ProgressEvent::EqualsForIDE(const ProgressEvent &other) const {
8787
return m_progress_id == other.m_progress_id &&
8888
m_event_type == other.m_event_type &&
89-
m_percentage == other.m_percentage;
89+
m_percentage == other.m_percentage && m_message == other.m_message;
9090
}
9191

9292
ProgressEventType ProgressEvent::GetEventType() const { return m_event_type; }

0 commit comments

Comments
 (0)