File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
splunk_add_on_ucc_modinput_test/functional/splunk Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -263,9 +263,18 @@ def repeat_search_until(
263263 @return: SearchState object.
264264 """
265265
266+ last_state : SearchState | None = None
267+
268+ def internal_condition_fn (state : SearchState ) -> bool :
269+ nonlocal last_state
270+ last_state = state
271+ if callable (condition_fn ):
272+ return condition_fn (state )
273+ return state .result_count > 0
274+
266275 it = self .search_probe (
267276 probe_spl = spl ,
268- verify_fn = condition_fn ,
277+ verify_fn = internal_condition_fn ,
269278 timeout = timeout ,
270279 interval = interval ,
271280 probe_name = None ,
@@ -275,5 +284,5 @@ def repeat_search_until(
275284 while True :
276285 wait = next (it )
277286 time .sleep (wait )
278- except StopIteration as si :
279- return si . value
287+ except StopIteration :
288+ return last_state
You can’t perform that action at this time.
0 commit comments