Skip to content

Commit cee7540

Browse files
committed
Add Finalize to the test to ensure we always get the end message, and update the doc string
1 parent bb079b2 commit cee7540

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

lldb/bindings/interface/SBProgressDocstrings.i

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@ The Progress class helps make sure that progress is correctly reported
1111
and will always send an initial progress update, updates when
1212
Progress::Increment() is called, and also will make sure that a progress
1313
completed update is reported even if the user doesn't explicitly cause one
14-
to be sent.") lldb::SBProgress;
14+
to be sent.
15+
16+
Progress can either be deterministic, incrementing up to a known total or non-deterministic
17+
with an unbounded total. Deterministic is better if you know the items of work in advance, but non-deterministic
18+
exposes a way to update a user during a long running process that work is taking place.
19+
20+
For non-deterministic
21+
22+
") lldb::SBProgress;
1523

1624
%feature("docstring",
1725
"Finalize the SBProgress, which will cause a progress end event to be emitted. This

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def create_options(cls):
3939
parser.add_option(
4040
"--total",
4141
dest="total",
42-
help="Total to count up, use None to identify as indeterminate",
42+
help="Total items in this progress object. When this option is not specified, this will be an indeterminate progress.",
4343
type="int",
4444
default=None,
4545
)
@@ -101,6 +101,9 @@ def __call__(self, debugger, command, exe_ctx, result):
101101
progress.Increment(1, f"Step {i}")
102102
time.sleep(cmd_options.seconds)
103103

104+
# Not required for deterministic progress, but required for indeterminate progress.
105+
progress.Finalize()
106+
104107

105108
def __lldb_init_module(debugger, dict):
106109
# Register all classes that have a register_lldb_command method

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def verify_progress_events(
1919
expected_not_in_message=None,
2020
only_verify_first_update=False,
2121
):
22-
self.dap_server.wait_for_event("progressEnd", 15)
22+
self.dap_server.wait_for_event("progressEnd", 5)
2323
self.assertTrue(len(self.dap_server.progress_events) > 0)
2424
start_found = False
2525
update_found = False

0 commit comments

Comments
 (0)